diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2023-10-20 09:30:25 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-23 10:49:17 +0100 |
commit | 589450af505de6a00ba7d7a3b647a514d1d1282f (patch) | |
tree | e2d4e4f893d8fd19774160fab4535a79a9bf0a21 | |
parent | 935d8d65488d5c08a84f7c43bb067c6660fec7a7 (diff) | |
download | openembedded-core-contrib-589450af505de6a00ba7d7a3b647a514d1d1282f.tar.gz |
lighttpd: update init script
- add configtest option
- add configtest before starting, restart, reload, force-reload
- change reload,force-reload to use lighttpd graceful restart
via kill signal USR1
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r-- | meta/recipes-extended/lighttpd/lighttpd/lighttpd | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/meta/recipes-extended/lighttpd/lighttpd/lighttpd b/meta/recipes-extended/lighttpd/lighttpd/lighttpd index 82fbaa523b..f369dce42c 100644 --- a/meta/recipes-extended/lighttpd/lighttpd/lighttpd +++ b/meta/recipes-extended/lighttpd/lighttpd/lighttpd @@ -6,9 +6,14 @@ NAME=lighttpd DESC="Lighttpd Web Server" OPTS="-f /etc/lighttpd/lighttpd.conf" +configtest() { + "$DAEMON" $OPTS -tt || exit 1 +} + case "$1" in start) echo -n "Starting $DESC: " + configtest start-stop-daemon --start -x "$DAEMON" -- $OPTS echo "$NAME." ;; @@ -17,16 +22,26 @@ case "$1" in start-stop-daemon --stop -x "$DAEMON" echo "$NAME." ;; - restart|force-reload) + restart) echo -n "Restarting $DESC: " + configtest start-stop-daemon --stop -x "$DAEMON" sleep 1 start-stop-daemon --start -x "$DAEMON" -- $OPTS echo "$NAME." ;; + reload|force-reload) + echo -n "Reloading $DESC: " + configtest + killall -USR1 "${DAEMON##*/}" + echo "$NAME." + ;; + configtest) + configtest + ;; *) N=/etc/init.d/$NAME - echo "Usage: $N {start|stop|restart|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|reload|force-reload|configtest}" >&2 exit 1 ;; esac |