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

Petter Reinholdtsen pere at hungry.com
Mon Nov 19 14:20:01 GMT 2018

[Dmitry Bogatov]
> Can you please elaborate, what exactly would break? Probably there is
> better solution for those issues that just swallowing error codes.

I do not remember the details any more, but after reading the git
history I have vague memories of having to add the exit calls to ensure
scripts loaded via /lib/lsb/init-functions.d/ did not break.  Possibly
and probably related to systemd integration at the time.

This is the relevant commit:

commit f611a05d16b3094139c2ea540817c00bdf93347a
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Thu Feb 20 13:03:07 2014 +0100

    Make sure init-d-script exit at the end, to make sure init.d script
    is only sourced once.

It was added only 10 days after the script was introduced in git, so I
guess the error was fairly obvious but not triggered with every script.
Perhaps only for scripts where there is no systemd service?

Happy hacking
Petter Reinholdtsen

More information about the Debian-init-diversity mailing list