Received: from mx1.tetrasec.net (mx1.tetrasec.net [66.245.176.36]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 52764781F03 for <~alpine/devel@lists.alpinelinux.org>; Wed, 16 Dec 2020 07:49:41 +0000 (UTC) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id C9C6E161483; Wed, 16 Dec 2020 07:49:40 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: alpine@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id BCECA161482; Wed, 16 Dec 2020 07:49:38 +0000 (UTC) Date: Wed, 16 Dec 2020 08:49:31 +0100 From: Natanael Copa To: Jakub Jirutka Cc: Jean-Louis Fuchs , Rasmus Thomsen , Francesco Colista , Leonardo , "~alpine/devel@lists.alpinelinux.org" <~alpine/devel@lists.alpinelinux.org>, =?ISO-8859-1?B?U/ZyZW4=?= Tempel Subject: Re: Use of supervise-daemon in Alpine Message-ID: <20201216084931.0fcd925c@ncopa-desktop.lan> In-Reply-To: <6da2794f-ff0e-f25b-5b3c-b406e540027a@jirutka.cz> References: <6da2794f-ff0e-f25b-5b3c-b406e540027a@jirutka.cz> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-alpine-linux-musl) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, 15 Dec 2020 15:33:16 +0100 Jakub Jirutka wrote: > Hi, >=20 > can you please all stop *forcing* supervise-daemon in init scripts > and let the users decide what supervisor they wanna use in the > corresponding conf file? As a few people have already written here, > OpenRC*s supervise-daemon is not very reliable and has bad defaults. > And yet, there are already 126 init scripts with *forced* > `supervisor=3Dsupervise-daemon`, i.e. the users cannot choose a > different supervisor or not supervisor at all without editing the > init script (which is not good). I agree with Jakub on this. We should try avoid force use of supervise-daemon if possible and make it configurable. =20 > If the init script is written correctly (the command does *not* > daemonize itself, `command_background=3Dyes`) and there*s no > `supervisor` set (!), the user can just create or edit the > corresponding `/etc/conf.d/` and add > `supervisor=3Dsupervise-daemon` to use supervise-daemon instead of the > default start-stop-daemon. Or you might predefine > `supervisor=3Dsupervise-daemon` in the conf file; the user still can > change it without any worries about upgrades. This is very useful. When we discussed this some time ago we never figured out how to do this. > RTFM http://manpages.org/openrc-run/8 Thanks. Last time i looked for official documentation for openrc (years ago) I ended up reading the raw groff from their git repo. was not very pleasant. (on a side note, the man page says "Note that supervise-daemon is still in early development, so it is considered experimental." so I think making it configurable makes alot sense) Jakub, do you think you could give us one or two examples how to do this properly? -nc > Best regards, > Jakub J. >=20 > On 9/2/20 9:01 AM, Jean-Louis Fuchs wrote: > > Hi > >=20 > > -----Original message----- =20 > >> From: Natanael Copa > >> Sent: Thursday 27th August 2020 17:13 > >> To: Rasmus Thomsen > >> Cc: Francesco Colista ; Leonardo > >> ; ~alpine/devel@lists.alpinelinux.org; S=F6ren > >> Tempel Subject: Re: Use of > >> supervise-daemon in Alpine =20 > > =20 > >> How about we fix supervise-daemon to accept an option or env var to > >> respawn? =20 > >=20 > > I think defaults aren't good too. I had this service nebula which > > is known to fail. supervise-daemon with the default options would > > restart it as fast as possible for some N times and then stop. > > Usually nebula fails because of network-conditions that take some > > to change again. So I added the last line below. These are good for > > network-problems, but at least bit slower restart per default would > > be better, not? nebula often dies at boot and that never slowed > > down my boot time. > >=20 > > Best > >=20 > > #!/sbin/openrc-run > > name=3D$RC_SVCNAME > > description=3D"Scalable overlay networking tool" > > cfgfile=3D"/etc/$RC_SVCNAME/config.yml" > > command=3D"/usr/sbin/$RC_SVCNAME" > > command_args=3D"-config $cfgfile" > > command_user=3D"$RC_SVCNAME" > > supervisor=3D"supervise-daemon" > > start_stop_daemon_args=3D"-D 60 -m 0" > > =20 >=20