Your message dated Thu, 15 Nov 2018 18:02:12 +0800
with message-id <[email protected]>
and subject line Re: /lib/init/init-d-script: exit 0 at end of script prevents 
all other exit codes
has caused the Debian Bug report #822753,
regarding /lib/init/init-d-script: exit 0 at end of script prevents all other 
exit codes
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
822753: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=822753
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: sysvinit-utils
Version: 2.88dsf-59.3
Severity: important

The last line of /lib/init/init-d-script is "exit 0".

That can't be right, can it? This overrides all other valid return codes which 
could be provided by the script. In almost all cases, even errors, $? is going 
to be 0.




-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.3.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages sysvinit-utils depends on:
ii  init-system-helpers  1.29
ii  libc6                2.22-7
ii  startpar             0.59-3

sysvinit-utils recommends no packages.

Versions of packages sysvinit-utils suggests:
pn  bootlogd  <none>
pn  sash      <none>

-- no debconf information

--- End Message ---
--- Begin Message ---
tags 822753 moreinfo
thanks

Thanks Petter,

Petter Reinholdtsen <[email protected]> writes:

> [Benda Xu]
>> Do you think init-d-script unconditionally returning 0 is a typo?
>> Should it be `exit $?` instead?
>
> Not quite sure, but as far as I know, the init.d scripts do not have a
> standard for exit codes.  There is no use of exit codes from init.d
> scripts in /etc/init.d/rc.  Error handling and reporting during start
> and stop is supposed to take place within the init.d script itself, not
> passed on to the caller as an exit code.
>
> With that background, it is no reason not to always return 0 unless
> incorrect arguments are used on the command line.
>
> As /etc/init.d/rc is not running with 'set -e', it do not really matter
> if the scripts exit with an error code.

Nice explanation, thank you indeed.  So it actually does not matter what
it returns from init-d-script.  I think we could close this bug for the
moment.

@J Mo, thank you for the bug report.  If you have a more specific demo
on why `exit 0` in /lib/init/init-d-script is incorrect, don't hesitate
to reopen this bug.

Yours,
Benda

--- End Message ---

Reply via email to