On Tue, Jun 30, 2015 at 02:35:42AM -0600, Bob Proulx wrote: > If /etc/mysql/debian-start outputs something, anything, then the test > for -n "$output" is true and then log_action_msg logs it and also > returns 0. But if /etc/mysql/debian-start emits nothing then output > is empty and -n "" is non-zero. At that point things fall through to > the bottom of the script and exits with the last exit code which means > the script exits non-zero as well. Because the action exits non-zero > the postinst script fails and dpkg --configure fails. > > Would it be possible to put an exit 0 at the bottom of the script? It > would be good programming. I think it is definitely unintended to > exit non-zero when /etc/mysql/debian-start doesn't print anything. > Note that the /etc/init.d/skeleton previously included a ":" at the > bottom to essentially do the same thing in a different way. I think > ending with a ":" to be more obscure than the more explicit exit 0 and > therefore prefer the latter. But either would be the same. All of > the error handling in the script explicitly exits with a non-zero > error upon detecting an error.
What if /etc/mysql/debian-start fails? Should we be checking the result code of this and exiting with the same status? Or should we be ignoring the result of /etc/mysql/debian-start (as I think we are now) and returning 0 in all cases, as the daemon itself has started? Although if we fail when /etc/mysql/debian-start fails, the daemon would already have been started even though we're returning failure which could be confusing.
signature.asc
Description: Digital signature