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

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



Hi Ansgar,

I am sorry to tell you that you are completely missing the point.

On Thu, Feb 06, 2014 at 11:35:17AM +0100, Ansgar Burchardt wrote:
> On 02/06/2014 10:56, Helmut Grohne wrote:
> > The relevant bits can be found in insserv, watch out for
> > "/lib/init/upstart-job".
> 
> The current version of insserv in unstable, 1.14.0-5, doesn't seem to
> contain this file.

insserv does not provide the upstart-job wrapper, but it supports(!) it
in being able to parse generated dependencies rather than reading the
init script.

> > My attempt to reproduce such a utility for systemd have not worked out
> > unfortunately (for lack of time/interest).
> 
> Using systemd jobs instead of the init script if available is already
> implemented:
> 
> ~ # /etc/init.d/cron restart
> [ ok ] Restarting cron (via systemctl): cron.service.

This functionality is entirely orthogonal to the one I was proposing.
You are talking about redirecting the init script invocation to a
running systemd instance. I am talking about sysvinit (as pid 1) to
execute systemd .service descriptions.

> How would the init script continue to work on sysvinit if it was
> replaced with a symlink as you said earlier?

When you invoke /etc/init.d/foo you really invoke the helper (e.g.
/lib/init/upstart-job). This helper evalutes its argv and determines,
that it is acting for service foo and what action to carry out. It then
reads the corresponding (the name foo must match here) job description
and carries out the configured actions.

Helmut


Reply to: