Re: Two line init.d scripts? Sure, that will work!
On 02/06/2014 07:36 AM, Petter Reinholdtsen wrote:
> [Russ Allbery]
>> It's probably worth mentioning that this is basically the path down
>> which OpenRC went, except that OpenRC has taken the concept somewhat
>> further to allow the dependencies to be specified in code instead of
>> comments (using special shell functions). You may want to take a
>> look at their syntax, since it's extremely close to what you're
>> doing but possibly a bit more fleshed out.
> Yeah, I discovered that OpenRC had a similar approach, but without
> staying compatible with our current set of scripts in /etc/init.d/.
 Sorry... what?!? :)
It's perfectly compatible. You just decide what you want to
(re-)implement or not. In fact, that's one of the very strong point of
OpenRC: it allows a very smooth migration away from sysv-rc, where one
can decide what to re-write or not.
> The two goals I had in mind were to allow us to migrate individual
> scripts to this system without having to replace sysv-rc, file-rc, or
> any of the other implementations currently running init.d scripts (ie
> stay compatible with the current LSB based init.d script format)
Since last summer, OpenRC has full support for LSB headers. Also, I
believe that OpenRC is the only init system replacement which allows to
mix dependencies with LSB or it's own implementation.
> and reduce the code duplication between init.d scripts. OpenRC can't
> provide both these, as far as I can see.
Look again! :)
> It solve a lot of other problems for sure. :)
> This approach also make it easier to identify the "simple" init.d
> scripts, and possibly also make it easier to integrate them with for
> example systemd and upstart by providing a replacement for the
> init-d-script script or by extending init-d-script.
Unfortunately, it doesn't, because there will be problems with
dependencies, as much as I understand.
 Because there's readers not assuming good faith: no pun intended,
just huge surprise to read that...