poky.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
From: Glenn Strauss <gs-yoctoproject.org@gluelogic.com>
To: poky@lists.yoctoproject.org
Cc: Glenn Strauss <gstrauss@gluelogic.com>
Subject: [PATCH 2/3] lighttpd: update init script
Date: Fri, 20 Oct 2023 07:48:44 -0400	[thread overview]
Message-ID: <20231020114845.100062-3-gs-yoctoproject.org@gluelogic.com> (raw)
In-Reply-To: <20231020114845.100062-1-gs-yoctoproject.org@gluelogic.com>

From: Glenn Strauss <gstrauss@gluelogic.com>

- 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>
---
 .../lighttpd/lighttpd/lighttpd                | 19 +++++++++++++++++--
 1 file 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
-- 
2.41.0


  parent reply	other threads:[~2023-10-20 11:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20 11:48 [PATCH 0/3] lighttpd-1.4.72 Glenn Strauss
2023-10-20 11:48 ` [PATCH 1/3] lighttpd: upgrade 1.4.71 -> 1.4.72 Glenn Strauss
2023-10-20 16:28   ` [poky] " Khem Raj
2023-10-20 11:48 ` Glenn Strauss [this message]
2023-10-20 11:48 ` [PATCH 3/3] lighttpd: modernize lighttpd.conf Glenn Strauss
2023-10-20 12:08 ` [poky] [PATCH 0/3] lighttpd-1.4.72 Richard Purdie
2023-10-20 12:18 ` Ross Burton
2023-10-20 12:54   ` gs-yoctoproject.org
2023-10-20 13:55     ` Ross Burton
2023-10-20 15:40       ` gs-yoctoproject.org
2024-03-14 18:32       ` Martin Jansa
     [not found]       ` <17BCB52E812AFFB8.6435@lists.yoctoproject.org>
2024-03-15  9:59         ` Martin Jansa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231020114845.100062-3-gs-yoctoproject.org@gluelogic.com \
    --to=gs-yoctoproject.org@gluelogic.com \
    --cc=gstrauss@gluelogic.com \
    --cc=poky@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).