[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian 8 how to install and run init.d scripts?



On Sat, Oct 26, 2019 at 08:59:16AM +0200, tomas@tuxteam.de wrote:
> On Fri, Oct 25, 2019 at 11:14:22PM +0200, Steffen Dettmer wrote:
> > Not sure if on topic, but I what is needed to guess, it should run the
> > scripts in order of their rcX/Snn number? I though the difficulty
> > would be to use a suited nn number (and in fact, if my init.d script
> > would get started at all it won't work because of a missing user as
> > it is started before pam ldap - this are places where I expect problems,
> > not at the attempt to run or not at all).
> 
> Even simpler than that: if you keep to the LSB init script spec [1] [2],
> the dependencies are stated explicitly: that should be exactly what
> systemd needs to calculate its dependencies.

In other words: no, systemd does not respect the Snn ordering of
the symlinks in /etc/rc*.d/.  It recalculates the dependencies on its
own, based on whatever information it is able to gather.

That information includes the parseable "comments" at the top of the
"simple shell script", which is really, really not just a "simple shell
script" at all.

Once you take into account that you're really writing an init.d script
in no less than *two* languages (one procedural language, sh, plus one
declarative language, the embedded comments at the top of the file),
*plus* incorporating knowledge of OS-specific tools like start-stop-daemon,
it should be clear why I claimed that a sysv-rc script is much more
complicated than a systemd unit.


Reply to: