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

Re: Two line init.d scripts? Sure, that will work!

Hi Pere,

On Wed, Feb 05, 2014 at 10:31:09PM +0100, Petter Reinholdtsen wrote:
> The idea is to let init.d scripts look like this:
>   #!/lib/init/init-d-script
>   # Provides:          daemon
>   # Required-Start:    $remote_fs $syslog
>   # Required-Stop:     $remote_fs $syslog
>   # Default-Start:     2 3 4 5
>   # Default-Stop:      0 1 6
>   # Short-Description: nice daemon
>   # Description:       Provide service to others
>   DAEMON=/usr/sbin/daemond

This idea has been brought up a fair number of times now. While others
have already pointed out, that this is basically the approach taken by
OpenRC, we have a very similar implementation in the archive for far
longer. It's called upstart!

The relevant bits can be found in insserv, watch out for
"/lib/init/upstart-job". It takes things one step further though.
Instead of having an interpreted script, it right out replaces the init
script with a symbolic link to the mentioned helper. That in turn can
derive the job name from argv[0] and use the existing upstart job

My attempt to reproduce such a utility for systemd have not worked out
unfortunately (for lack of time/interest).

So yeah, the approach taken is one that is known to be good. The main
downside I see with your particular implementation is that your answer
to the problem of too many standards is adding yet another one.

Why not write an upstart job instead? It works with sysvinit today!


Reply to: