Mail archive
alpine-aports

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

From: Leonardo Arena <rnalrd_at_gmail.com>
Date: Fri, 26 Oct 2018 15:43:43 +0200

Hi,

thank you for your patch. Please look at some comments below.

On Thu, Oct 25, 2018 at 5:15 PM Milliardo Peacecraft <milliardo_at_firemail.cc>
wrote:

> 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__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"
>

Looking at sources and man page I think $SVCNAME is deprecated, $RC_SVCNAME
should be used instead.
Also, since it does not run as root it would be preferrable to place the
pidfile under "/run/darkhttpd" and use "checkpath" from init in order to
create $rundir with the right uid/gid. Since the pidfile is created by
openrc, the $pidfile creation is successful anyway in this case.

Also please remember to bump $pkgrel in APKBUILD for any change.

Thanks!

/eo



---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Fri Oct 26 2018 - 15:43:43 UTC