Bug#752075: daemontools-run: Add systemd support

Gerrit Pape pape at dbnbgs.smarden.org
Tue Jul 22 15:20:23 BST 2014


On Tue, Jul 22, 2014 at 03:03:02PM +0200, Michael Biebl wrote:
> Am 22.07.2014 14:34, schrieb Gerrit Pape:
> > Hi, I've now prepared this changeset.  Do you have any comments on it?

> > diff --git a/debian/daemontools-run.postinst b/debian/daemontools-run.postinst
> > index d51ac09..1d7aae1 100644
> > --- a/debian/daemontools-run.postinst
> > +++ b/debian/daemontools-run.postinst
> > @@ -74,3 +74,7 @@ if ! grep '^SV:' /etc/inittab >/dev/null; then
> >    mv -f /etc/inittab'{new}' /etc/inittab
> >    kill -s HUP 1
> >  fi
> > +if test "$(readlink /sbin/init || :)" = /lib/systemd/systemd; then
> > +  systemctl enable -f daemontools.path
> > +  systemctl start daemontools.path
> > +fi
> 
> The canonical check if systemd is PID 1 is
> 
> "test -d /run/systemd/system"

Thanks.

> That said, the logic you added is incomplete/broken in several ways:
> 
> The user first installs daemontools-run, later on systemd => the
> daemon-tools service will not be enabled

How can I achieve this without calling systemctl?  Creating the symlink
to /etc/systemd/system/... manually, unconditionally?

> The user deinstalls systemd. Later on he deinstalls daemontools-run =>
> the symlinks will not be cleaned up.

So I should create and remove the symlinks unconditionally then, without
using systemctl.

> The systemctl enable call is run on every update. => If the admin has
> disabled the service, it will be re-enabled

Yes, the daemontools-run package is the very service, to disable it, the
package is removed.

> I didn't look further. There are probably more cases your maintainer
> scripts don't handle correctly.
> 
> 
> There is a reason, why we added the logic in a single place.

With sysvinit I have the logic easily implemented in the maintainer
scripts.  With runit it's even more simple.  I really don't want to
depend on some complex logic and an additional package just to have a
service as simple as the daemontools' one installed and always running,
think the inittab approach.

Regards, Gerrit.




More information about the Pkg-systemd-maintainers mailing list