sysvinit should depend on initscripts for a functional /lib/sysvinit/init

josh at joshtriplett.org josh at joshtriplett.org
Wed May 6 01:19:30 BST 2015


On Wed, May 06, 2015 at 01:53:34AM +0200, Michael Biebl wrote:
> Am 06.05.2015 um 01:38 schrieb josh at joshtriplett.org:
> > On Tue, May 05, 2015 at 07:24:41PM +0200, Michael Biebl wrote:
> 
> >> d/ insserv needs to be fixed to not barf if the facilities provided by
> >> the initscripts package are not around and handle this gracefully (by
> >> simply ignoring them).
> > 
> > Didn't know about that one, but that sounds reasonable.  However,
> > insserv only makes sense on sysvinit systems, and those systems should
> > have initscripts, so that might be another path to fixing the problem.
> 
> Not quite. For packages which only ship a sysv init script, we need
> insserv to setup the symlinks in /etc/rc?.d/
> systemd determines the enabled state of sysv init scripts by checking
> the symlinks in those directories.
> If you only ship a sysv init script but no symlinks, systemd would
> consider the service disabled.

Fair enough, but all the logic for deciding how to number the init
script is entirely irrelevant under systemd.

In any case, I'm also looking ahead towards packages that don't ship
init scripts.

> >> e/ /lib/init/vars.sh: This shell library is sourced by quite a few init
> >> scripts (261 according to codesearch) to get some basic SysV settings.
> >> I'm a bit unsure what to do about this one. I bet, most of them don't
> >> actually use the variables set by vars.sh, so they could simply drop
> >> this include. That said, moving it into another package is probably the
> >> simplest option. sysv-rc looks like a possible candidate.
> > 
> > The few packages using the settings from /etc/default/rcS and similar
> > via vars.sh should be fixed to obtain them directly.  The only thing
> > needed by the majority of shell scripts is VERBOSE, and I would suggest
> > moving that logic into init-functions, since all scripts should be
> > sourcing that already.
> 
> I assume most packages only use vars.sh for the VERBOSE flag, indeed.
> I also think, it's pretty ugly that this isn't handled internally in the
> lsb_* logging functions but having this implementation detail pulled
> into every init scripts and littered with stuff like
>   [ "$VERBOSE" = no ] || log_action_end_msg bla

That would be nice as well; I tried to get that change made, but it
isn't backward-compatible.  I think this will require adding new
versions of the log_* functions and transitioning to those.

> That said, as it stands today, 261 packages *do* source
> /lib/init/vars.sh. That's quite a bit of work to get all those packages
> updated to not use vars.sh. Work, that is probably better spent on
> providing native service files.

Perhaps, but until we can throw away the corresponding init scripts, it
still matters.

- Josh Triplett




More information about the Pkg-systemd-maintainers mailing list