]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
lighttpd: update init script
authorGlenn Strauss <gstrauss@gluelogic.com>
Fri, 20 Oct 2023 13:30:25 +0000 (09:30 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 23 Oct 2023 09:49:17 +0000 (10:49 +0100)
- 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>
meta/recipes-extended/lighttpd/lighttpd/lighttpd

index 82fbaa523bb4e64d1bde2eec8e18b3cb16f3158b..f369dce42c69ea9d7798cd95b35dd88725c39c32 100644 (file)
@@ -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