Debhelper-generated postinst and prerm vs. manual one

Roberto C. Sanchez roberto at connexer.com
Fri Oct 20 21:43:24 UTC 2006


On Fri, Oct 20, 2006 at 04:22:27PM -0300, Henrique de Moraes Holschuh wrote:
> On Fri, 20 Oct 2006, Fabian Fagerholm wrote:
> > 1. saslauthd binary missing from /usr/sbin
> > 
> > If the saslauthd binary hasn't been placed in /usr/sbin when dpkg runs
> 
> Package was removed but not purged.  Really, this is a standard issue with
> all cron jobs and init scripts.
> 
> > -# Exit if the package is not installed
> > -[ -x "$DAEMON" ] || exit $EXIT_ERROR_CODE
> > -
> 
> Do not remove this.  It would be a big bug.
> 
I agree.

> > -# If the daemon is not enabled, give the user a useful error and then exit
> > +# If the daemon is not enabled, give the user a warning and then exit
> >  if [ "$START" != "yes" ]; then
> > -	log_failure_msg "To enable $NAME, edit /etc/default/$NAME and add START=yes"
> > -	exit $EXIT_ERROR_CODE
> > +	log_warning_msg "To enable $NAME, edit /etc/default/$NAME and set START=yes"
> > +	exit 0
> >  fi
> 
> Correct, if it is disabled, exit 0 always.
> 
I disagree.  Please take another look at #257181.  While I understand
that if START=yes is not set, the daemon is disabled, I don't think that
the exit code if `invoke-rc.d saslauthd start` should be 0 if the daemon
does not actually start.  Think of it like this.  You develop a script
that you intend to distribute to Linux users (not Debian specific).  One
of the components of that script is start saslauthd.  You naively write
`invoke-rc.d saslauthd start` and expect that a successful exit means
that the daemon actually started.

The only case where this does not hold is on install, since dpkg will
fail to finish installing the package if the script exits with a
non-zero exit code.

I understand that there is good reason to leave it disabled by default.
However, I don't think that means that if it stays disabled and someone
or something tries to start it and fails that is somehow not an error.

> > -# If no mechanisms are defined, log this and exit
> > +# If no mechanisms are defined, fall back to pam
> 
> This goes against both KISS and the principle of least surprise.  If no
> mechs are defined, bombing out with an error is best IMHO.  Just make sure
> the default for the package is to have START disabled so that saslauth is
> not started by default in unconfigured state.
> 
I agree.

Please take a look at the patch that I sent in reply to Fabian's
proposed patch.  I think that one represents a good compromise.

Regards,

-Roberto

-- 
Roberto C. Sanchez
http://people.connexer.com/~roberto
http://www.connexer.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-cyrus-sasl2-debian-devel/attachments/20061020/0942763e/attachment-0001.pgp


More information about the Pkg-cyrus-sasl2-debian-devel mailing list