[Pkg-sysvinit-devel] Make init.d/skeleton a very simple init.d script?

Petter Reinholdtsen pere at hungry.com
Mon Feb 3 10:06:33 UTC 2014


[Henrique de Moraes Holschuh]
> Either "command -V", "command -v", or the "type" builtins should do, I
> suppose.  Both dash and bash support them.
> 
> Note that it is non-trivial to know that the name really is a function due
> to aliases, etc.  There is a bashism for this, but dash doesn't support it.
> I don't think this detail matters for our intended use, though.

Ah, great.  Thank you for the tip.  I've implemented a second draft
with reload support detection, pushed to the simpler-init-scripts
branch.  Check it out.  Still need some cleanup in the actual daemon
startup and lsb style reporting, I believe (should we split do_start
in two, one doing the lsb style reporting and another doing the
startup?), but the general structure should be ok.

The implementation change the behaviour of usage() and
do_force_reload() based on the availability of a do_reload() function,
make sure the latter is presented as an optoin and used to reload.  If
it isn't, do_force_reload() call do_restart().

-- 
Happy hacking
Petter Reinholdtsen



More information about the Pkg-sysvinit-devel mailing list