X-Original-To: alpine-aports@lists.alpinelinux.org Received: from mail-vs1-f68.google.com (mail-vs1-f68.google.com [209.85.217.68]) by lists.alpinelinux.org (Postfix) with ESMTP id B00645C5849 for ; Fri, 26 Oct 2018 13:43:55 +0000 (GMT) Received: by mail-vs1-f68.google.com with SMTP id c10so809436vsk.2 for ; Fri, 26 Oct 2018 06:43:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3ToM/unDsVB3SuPRdKNvlremRd/YF8vgF6crj0HvzYs=; b=ZJ4hIONpJpxkHahIXTzub59WbNMbbRdR5DOB84zVQQnj2ZlY8W6k6RaOKf9xpWm2j/ Uk24RCrC5Ot0tz6QLWP/GzzElbT/z5r029GM/uC33SvHOTAY+ZvR9ijgZZA39wScl2bA 83hRoU6nBbsGP13KEzx2j46YRhQmfIuR8xHwr06xdbO9MYFMXYiud0IGiCqHaJhWM06i psGQ45adHpiH9NYtmqgoVcWa2+b2pGu7u4wX+ZBCty//PPFr79hDBNyqLUfvFqL7qUKy ajHFFyaJb2WEtbB0NQKB0mMmJFyHyRUUh0B+fygJgQ1SoTPnFNDihlLT5zp7YV/Hkxf8 xmyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3ToM/unDsVB3SuPRdKNvlremRd/YF8vgF6crj0HvzYs=; b=KTk8jrTnPgbX1pr74/DXmglj5S/GoyHSbbdl5CFKSoekmxsadR3K6RlICaJDg6/1h+ b1IQXMWGZJcqtmxwmBgwgnFMu0Iq/vx5nZRqk1KYAJpmyly1bwQD0c+DShxqDnb/0N2G fAsYuRIIZdnX5GWYFflyrjmztXUncsf0tv4rzNkEGg5QsaT/7G+J7rC1dsa7NdetgbHr I58OlqWM4uscCdshqxQXDObEBJelJ5bCSskzJpCqrA3TJgqKmLM3jFDrkpmGyToGFVvf TiKyHBrAZENo4InNdrxjsoff8s67XKsI+XHzqK86XRMkDi0qRN52U5rEbNvp55BpWjig 1ioQ== X-Gm-Message-State: AGRZ1gLg82lf+fFU9dtrHde0udvbvg1KZUSP/Nv/+BKQkiaUcgCRBTaa opw3uzFZPBBfu4spIKMzIPlulMAtusiI+rc69BzUiQ== X-Google-Smtp-Source: AJdET5cD7foL2EX3poku5lkal3WS1VoD68XkcwiS2JVVUJQ/3HKwsT6ZV66YJskmk3DAPcLfyEb8MN2utSsupGYW4bA= X-Received: by 2002:ab0:2399:: with SMTP id b25mr1591169uan.73.1540561434947; Fri, 26 Oct 2018 06:43:54 -0700 (PDT) X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 References: In-Reply-To: From: Leonardo Arena Date: Fri, 26 Oct 2018 15:43:43 +0200 Message-ID: Subject: Re: [alpine-aports] [PATCH] main/darkhttpd: Fix multiple instances support To: milliardo@firemail.cc Cc: alpine-aports Content-Type: multipart/alternative; boundary="00000000000015b3c9057921e9e7" --00000000000015b3c9057921e9e7 Content-Type: text/plain; charset="UTF-8" Hi, thank you for your patch. Please look at some comments below. On Thu, Oct 25, 2018 at 5:15 PM Milliardo Peacecraft 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 > --- > 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 > @@ -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 --00000000000015b3c9057921e9e7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

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

On Thu, Oct 25, 2018 at 5:15 PM Milliardo Peacecraft &l= t;milliardo@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@firemail.cc>
---
=C2=A0main/darkhttpd/darkhttpd.initd | 7 +++----
=C2=A01 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/main/darkhttpd/darkhttpd.initd b/main/darkhttpd/darkhttpd.init= d
index b16244b25c..38d33f3a69 100644
--- a/main/darkhttpd/darkhttpd.initd
+++ b/main/darkhttpd/darkhttpd.initd
@@ -2,10 +2,9 @@

=C2=A0description=3D"darkhttpd web server"
=C2=A0command=3D"/usr/bin/darkhttpd"
-command_args=3D"${document_root:-/var/www/localhost/htdocs} --chroot = --daemon --uid darkhttpd --gid www-data $darkhttpd_args"
-procname=3D"darkhttpd"
-pidfile=3D""
-stopsig=3D"SIGTERM"
+command_args=3D"${document_root:-/var/www/localhost/htdocs} --chroot = --uid darkhttpd --gid www-data $darkhttpd_args"
+command_background=3D"true"
+pidfile=3D"/run/$SVCNAME.pid"

Looking at sources and man page I think $SVCNAME is deprecated, $RC_SVCNA= ME 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 th= e right uid/gid. Since the pidfile is created by openrc, the $pidfile creat= ion is successful anyway in this case.

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

Thanks!

/eo
--00000000000015b3c9057921e9e7-- --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---