Mail archive
alpine-aports

[alpine-aports] [PATCH] main/darkhttpd: Fix multiple instances support

From: Milliardo Peacecraft <milliardo_at_firemail.cc>
Date: Thu, 25 Oct 2018 15:15:06 +0000

5fd553eceec8325f829089d13e5828e002393438 was supposed to allow
multiple instances, but given that it defines `procname`, SIGTERM
gets delivered to all running instances. Instead, don't daemonize
darkhttpd and let start-stop-daemon(8) handle process forking and
pidfile creation. This was chosen over using `--pidfile` flag of
darkhttpd because pidfile is created inside the chroot in such
case.

Signed-off-by: Milliardo Peacecraft <milliardo_at_firemail.cc>
---
 main/darkhttpd/darkhttpd.initd | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/main/darkhttpd/darkhttpd.initd b/main/darkhttpd/darkhttpd.initd
index b16244b25c..38d33f3a69 100644
--- a/main/darkhttpd/darkhttpd.initd
+++ b/main/darkhttpd/darkhttpd.initd
_at_@ -2,10 +2,9 @@
 
 description="darkhttpd web server"
 command="/usr/bin/darkhttpd"
-command_args="${document_root:-/var/www/localhost/htdocs} --chroot --daemon --uid darkhttpd --gid www-data $darkhttpd_args"
-procname="darkhttpd"
-pidfile=""
-stopsig="SIGTERM"
+command_args="${document_root:-/var/www/localhost/htdocs} --chroot --uid darkhttpd --gid www-data $darkhttpd_args"
+command_background="true"
+pidfile="/run/$SVCNAME.pid"
 start_stop_daemon_args="-q"
 
 optional_arg() {
-- 
2.19.1
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Thu Oct 25 2018 - 15:15:06 UTC