Michael DeHaan wrote:
I am not sure I agree with this one; I'd like to know if the
restart
failed.
I think being this verbose conflicts with the Fedora guidelines
(though I'm not positive that's the case -- nor if that is a
significant factor in whether to make this change in the upstream
cobbler spec file).
If every package that restarted a service did this, the yum output
would be quite messy. As it is, most packages don't do this, so users
really can't count on finding out whether a condrestart has failed via
the output of yum anyway. Right now, cobbler stands out as one of the
few that does display this info. Perhaps an argument can be made that
all the other packages which don't do this should be fixed, but that's
probably a long talk for the fedora-packaging list. ;)
At the very least, we need to ensure that the scriptlet exits with a 0
status:
https://fedoraproject.org/wiki/Packaging/ScriptletSnippets
"Except in some really exceptional cases (if any), we want all
scriptlets to exit with the zero exit status. Because rpm in its
default configuration does not at the moment execute shell scriptlets
with the -e argument to the shell, excluding explicit exit calls
(frowned upon with a non-zero argument!), the exit status of the last
command in a scriptlet determines its exit status. Most commands in
the snippets in this document have a "|| :" appended to them, which is
a generic trick to force the zero exit status for those commands
whether they worked or not. Usually the most important bit is to apply
this to the last command executed in a scriptlet, or to add a separate
command such as plain ":" or "exit 0" as the last one in a scriptlet.
Note that depending on the case, other error checking/prevention
measures may be more appropriate, as well as running some commands
only if we saw a previous command in the scriptlet which is a must
prerequisite to succeed.
Non-zero exit codes from scriptlets break installs/upgrades/erases so
that no further actions will be taken for that package in a
transaction (see scriptlet ordering below), which may for example
prevent an old version of a package from being erased on upgrades,
leaving behind duplicate rpmdb entries and possibly stale, unowned
files on the filesystem. There are some cases where letting the
transaction to proceed when some things in scriptlets failed may
result in partially broken setup. It is however often limited to that
package only whereas letting a transaction to proceed with some
packages dropped out on the fly is more likely to result in broader
system wide problems."
--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL:
www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I may kid around about drugs, but really, I take them seriously.
-- Doctor Graper