135f6587840b71c8bd3e3655508b6f05cb2593ba9Daniel Erat# Copyright 2015 The Android Open Source Project
235f6587840b71c8bd3e3655508b6f05cb2593ba9Daniel Erat#
335f6587840b71c8bd3e3655508b6f05cb2593ba9Daniel Erat# Licensed under the Apache License, Version 2.0 (the "License");
435f6587840b71c8bd3e3655508b6f05cb2593ba9Daniel Erat# you may not use this file except in compliance with the License.
535f6587840b71c8bd3e3655508b6f05cb2593ba9Daniel Erat# You may obtain a copy of the License at
635f6587840b71c8bd3e3655508b6f05cb2593ba9Daniel Erat#
735f6587840b71c8bd3e3655508b6f05cb2593ba9Daniel Erat#      http://www.apache.org/licenses/LICENSE-2.0
835f6587840b71c8bd3e3655508b6f05cb2593ba9Daniel Erat#
935f6587840b71c8bd3e3655508b6f05cb2593ba9Daniel Erat# Unless required by applicable law or agreed to in writing, software
1035f6587840b71c8bd3e3655508b6f05cb2593ba9Daniel Erat# distributed under the License is distributed on an "AS IS" BASIS,
1135f6587840b71c8bd3e3655508b6f05cb2593ba9Daniel Erat# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1235f6587840b71c8bd3e3655508b6f05cb2593ba9Daniel Erat# See the License for the specific language governing permissions and
1335f6587840b71c8bd3e3655508b6f05cb2593ba9Daniel Erat# limitations under the License.
14039da31d4ac1a92ab9aad2273083028ede43054Alex Vakulenko
15039da31d4ac1a92ab9aad2273083028ede43054Alex Vakulenkodescription     "Brillo WebServer Daemon"
16039da31d4ac1a92ab9aad2273083028ede43054Alex Vakulenkoauthor          "chromium-os-dev@chromium.org"
17039da31d4ac1a92ab9aad2273083028ede43054Alex Vakulenko
185313123aeb9c1f35df26b3db17cff1566073fd78Alex Vakulenkostart on starting system-services
19039da31d4ac1a92ab9aad2273083028ede43054Alex Vakulenkostop on stopping system-services
20039da31d4ac1a92ab9aad2273083028ede43054Alex Vakulenkorespawn
21039da31d4ac1a92ab9aad2273083028ede43054Alex Vakulenko
2231a6379d5f773cb40312d2085e07f30cf3ac685dAlex Vakulenkoenv WEBSERVD_LOG_LEVEL=0
2331a6379d5f773cb40312d2085e07f30cf3ac685dAlex Vakulenkoenv WEBSERVD_DEBUG=false
248db2b534b447db87d450ffa0d1351236cf31f627Alex Vakulenkoenv WEBSERVD_CONFIG_PATH=
2531a6379d5f773cb40312d2085e07f30cf3ac685dAlex Vakulenko
26039da31d4ac1a92ab9aad2273083028ede43054Alex Vakulenkopre-start script
27039da31d4ac1a92ab9aad2273083028ede43054Alex Vakulenko  mkdir -m 0755 -p /var/log/webservd
28039da31d4ac1a92ab9aad2273083028ede43054Alex Vakulenko  chown webservd:webservd /var/log/webservd
29039da31d4ac1a92ab9aad2273083028ede43054Alex Vakulenkoend script
30039da31d4ac1a92ab9aad2273083028ede43054Alex Vakulenko
3131a6379d5f773cb40312d2085e07f30cf3ac685dAlex Vakulenkoexec /usr/bin/webservd \
3231a6379d5f773cb40312d2085e07f30cf3ac685dAlex Vakulenko    --v="${WEBSERVD_LOG_LEVEL}" \
338db2b534b447db87d450ffa0d1351236cf31f627Alex Vakulenko    --config_path="${WEBSERVD_CONFIG_PATH}" \
3431a6379d5f773cb40312d2085e07f30cf3ac685dAlex Vakulenko    --debug="${WEBSERVD_DEBUG}" \
35