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

Re: How to check for other init systems from sysvinit script



 ❦ 30 mai 2013 23:47 CEST, Steve Langasek <vorlon@debian.org> :

>> > No, it won't.  What it will do is provide a shell function you can call to
>> > check if init is upstart, and if so, neuter your init script:
>
>> >   if init_is_upstart; then
>> >     exit 1
>> >   fi
>
>> > Doing this automatically by including /lib/lsb/init-functions would be EBW.
>
>> What does EBW means? Having the upstart job masks automatically the SysV
>> init script would be convenient. It works fine for systemd.
>
> Evil, Bad, Wrong.  Shell libraries (or any libraries) shouldn't call 'exit'
> for you.
>
> Upstart jobs do mask init scripts of the same name, at the startpar/insserv
> level - and also in invoke-rc.d (for maintainer scripts) and service (for
> admins).  Having /lib/lsb/init-functions also pass through to upstart would
> be possible, but I don't think it's desirable - and it's not what's
> currently implemented.

I still use /etc/init.d/XXXX start by habit and I find it convenient to
divert to systemd but I have no strong opinion on this. As long as
upstart jobs mask init scripts when booting, we are fine.

Unrelated, it would be convenient to have start/stop/restart/reload work
for all inits. I find those keywords more easy to use than invoke-rc.d.
-- 
Treat end of file conditions in a uniform manner.
            - The Elements of Programming Style (Kernighan & Plauger)

Attachment: pgpI_4f_u0eJ7.pgp
Description: PGP signature


Reply to: