Hi
-----Original message-----
> From: Natanael Copa <ncopa@alpinelinux.org>> Sent: Thursday 27th August 2020 17:13> To: Rasmus Thomsen <oss@cogitri.dev>> Cc: Francesco Colista <fcolista@alpinelinux.org>; Leonardo <rnalrd@gmail.com>; ~alpine/devel@lists.alpinelinux.org; Sören Tempel <soeren@soeren-tempel.net>> Subject: Re: Use of supervise-daemon in Alpine> How about we fix supervise-daemon to accept an option or env var to> respawn?
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.
Best
#!/sbin/openrc-run
name=$RC_SVCNAME
description="Scalable overlay networking tool"
cfgfile="/etc/$RC_SVCNAME/config.yml"
command="/usr/sbin/$RC_SVCNAME"
command_args="-config $cfgfile"
command_user="$RC_SVCNAME"
supervisor="supervise-daemon"
start_stop_daemon_args="-D 60 -m 0"
Hi,
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=supervise-daemon`, i.e. the users cannot choose a different supervisor or not supervisor at all without editing the init script (which is not good).
If the init script is written correctly (the command does *not* daemonize itself, `command_background=yes`) and there’s no `supervisor` set (!), the user can just create or edit the corresponding `/etc/conf.d/<svcname>` and add `supervisor=supervise-daemon` to use supervise-daemon instead of the default start-stop-daemon. Or you might predefine `supervisor=supervise-daemon` in the conf file; the user still can change it without any worries about upgrades.
RTFM http://manpages.org/openrc-run/8
Best regards,
Jakub J.
On 9/2/20 9:01 AM, Jean-Louis Fuchs wrote:
> Hi> > -----Original message----->> From: Natanael Copa <ncopa@alpinelinux.org>>> Sent: Thursday 27th August 2020 17:13>> To: Rasmus Thomsen <oss@cogitri.dev>>> Cc: Francesco Colista <fcolista@alpinelinux.org>; Leonardo <rnalrd@gmail.com>; ~alpine/devel@lists.alpinelinux.org; Sören Tempel <soeren@soeren-tempel.net>>> Subject: Re: Use of supervise-daemon in Alpine> >> How about we fix supervise-daemon to accept an option or env var to>> respawn?> > 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.> > Best> > #!/sbin/openrc-run> name=$RC_SVCNAME> description="Scalable overlay networking tool"> cfgfile="/etc/$RC_SVCNAME/config.yml"> command="/usr/sbin/$RC_SVCNAME"> command_args="-config $cfgfile"> command_user="$RC_SVCNAME"> supervisor="supervise-daemon"> start_stop_daemon_args="-D 60 -m 0">
On Tue, 15 Dec 2020 15:33:16 +0100
Jakub Jirutka <jakub@jirutka.cz> wrote:
> Hi,> > 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=supervise-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.
> If the init script is written correctly (the command does *not*> daemonize itself, `command_background=yes`) and there*s no> `supervisor` set (!), the user can just create or edit the> corresponding `/etc/conf.d/<svcname>` and add> `supervisor=supervise-daemon` to use supervise-daemon instead of the> default start-stop-daemon. Or you might predefine> `supervisor=supervise-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.> > On 9/2/20 9:01 AM, Jean-Louis Fuchs wrote:> > Hi> > > > -----Original message----- > >> From: Natanael Copa <ncopa@alpinelinux.org>> >> Sent: Thursday 27th August 2020 17:13> >> To: Rasmus Thomsen <oss@cogitri.dev>> >> Cc: Francesco Colista <fcolista@alpinelinux.org>; Leonardo> >> <rnalrd@gmail.com>; ~alpine/devel@lists.alpinelinux.org; Sören> >> Tempel <soeren@soeren-tempel.net> Subject: Re: Use of> >> supervise-daemon in Alpine > > > >> How about we fix supervise-daemon to accept an option or env var to> >> respawn? > > > > 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.> > > > Best> > > > #!/sbin/openrc-run> > name=$RC_SVCNAME> > description="Scalable overlay networking tool"> > cfgfile="/etc/$RC_SVCNAME/config.yml"> > command="/usr/sbin/$RC_SVCNAME"> > command_args="-config $cfgfile"> > command_user="$RC_SVCNAME"> > supervisor="supervise-daemon"> > start_stop_daemon_args="-D 60 -m 0"> > >