packages/net/lighttpd/files/lighttpd.init
Philip Prindeville c3345a6d4a lighttpd: add 'reload' to init script to make logrotate-friendly
If lighttpd's scripts are rotated from under it while they're still open,
this will cause some weird things to happen.  Give it a heads up that
the logs have moved.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2017-07-10 16:11:19 -06:00

33 lines
590 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org
START=50
STOP=50
USE_PROCD=1
PROG=/usr/sbin/lighttpd
validate_conf() {
$PROG -tt -f /etc/lighttpd/lighttpd.conf >/dev/null 2>&1 || {
echo "validation failed"
return 1
}
}
start_service() {
user_exists http || user_add http
[ -d /var/log/lighttpd ] || {
mkdir -m 0775 -p /var/log/lighttpd
chgrp www-data /var/log/lighttpd
}
validate_conf || exit 1
procd_open_instance
procd_set_param command $PROG -D -f /etc/lighttpd/lighttpd.conf
procd_close_instance
}
reload_service() {
procd_send_signal lighttpd
}