Bug#822753: /lib/init/init-d-script: exit 0 at end of script prevents all other exit codes

Ian Jackson ijackson at chiark.greenend.org.uk
Fri Nov 16 13:45:13 GMT 2018


(re-sending with un-mangled bug address)

Dmitry Bogatov writes ("Re: /lib/init/init-d-script: exit 0 at end of script prevents all other exit codes"):
> Wait, no. There is. See #427889 and policy 9.3.2. By the way, seems
> #427889 could be closed...
> 
> Also, by just common sence, program that return 0 in case of failure is
> bad, very bad.  What if I want to call /etc/init.d/{foo} in my own
> script?

A related question has been discussed in the Debian TC,

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=904558
  What should happen when maintscripts fail to restart a service

It seems that the likely consensus there will be that at least some of
the time, a postinst ought to fail when the daemon fails to start.
Since the daemon is usually started by running the init script, that
means the init script must report a useful exit status.

> So either we
> 
>  * violate LSB and adjust all initscripts to return 0 always.
>    I strongly oppose.

I don't think we should do this.  So, I agree.

>  * consider script, that swallows exit code to be buggy. I support it,
>    but there is a lot of scripts in wild that do so. I do /not/ volonteer
>    to fix them.

I agree with this.

> All in all, let us remove last line in `init-d-script'.

I haven't looked at this.  Are you happy for me to take your word for
how to implement what you suggest, or do you want me to do a code
review ?

Regards,
Ian.

-- 
Ian Jackson <ijackson at chiark.greenend.org.uk>   These opinions are my own.

If I emailed you from an address @fyvzl.net or @evade.org.uk, that is
a private address which bypasses my fierce spamfilter.




More information about the Debian-init-diversity mailing list