Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] lighttpd: source default file from startup script
@ 2017-03-08 15:21 Philipp Skadorov
  2017-03-08 17:34 ` Baruch Siach
  2017-03-08 20:11 ` Thomas Petazzoni
  0 siblings, 2 replies; 8+ messages in thread
From: Philipp Skadorov @ 2017-03-08 15:21 UTC (permalink / raw)
  To: buildroot

lighttpd server runs cgi application that has no way to get environment
variables that are set up for it.

S50lighttpd is changed to source /etc/default/lighttpd file where these
environment variables can be set up.

Signed-off-by: Philipp Skadorov <philipp.skadorov@savoirfairelinux.com>
---
 package/lighttpd/S50lighttpd | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/package/lighttpd/S50lighttpd b/package/lighttpd/S50lighttpd
index 44ac257c1..b3518cd27 100644
--- a/package/lighttpd/S50lighttpd
+++ b/package/lighttpd/S50lighttpd
@@ -2,15 +2,21 @@
 #
 # Starts lighttpd.
 #
+NAME=lighttpd
+DAEMON=/usr/sbin/$NAME
+PID_FILE="/var/run/$NAME.pid"
+CONF_FILE="/etc/$NAME/$NAME.conf"
+
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
 start() {
 	printf "Starting lighttpd: "
-	start-stop-daemon -S -q -p /var/run/lighttpd.pid --exec /usr/sbin/lighttpd -- -f /etc/lighttpd/lighttpd.conf
+	start-stop-daemon -S -q -p $PID_FILE --exec $DAEMON -- -f $CONF_FILE
 	echo "OK"
 }
 stop() {
 	printf "Stopping lighttpd: "
-	start-stop-daemon -K -q -p /var/run/lighttpd.pid
+	start-stop-daemon -K -q -p $PID_FILE
 	echo "OK"
 }
 restart() {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-03-09 20:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-08 15:21 [Buildroot] [PATCH 1/1] lighttpd: source default file from startup script Philipp Skadorov
2017-03-08 17:34 ` Baruch Siach
2017-03-08 18:44   ` Philipp Skadorov
2017-03-08 18:57     ` Baruch Siach
2017-03-08 20:11 ` Thomas Petazzoni
2017-03-08 20:43   ` [Buildroot] [PATCH v2 1/2] lighttpd: carry common keywords out to variables Philipp Skadorov
2017-03-08 20:43     ` [Buildroot] [PATCH v2 2/2] lighttpd: source default file from startup script Philipp Skadorov
2017-03-09 20:53     ` [Buildroot] [PATCH v2 1/2] lighttpd: carry common keywords out to variables Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox