Debhelper-generated postinst and prerm vs. manual one

Roberto C. Sanchez roberto at connexer.com
Sat Oct 21 07:24:35 UTC 2006


On Fri, Oct 20, 2006 at 12:22:12PM +0300, Fabian Fagerholm wrote:
> On Fri, 2006-10-20 at 04:39 -0400, Roberto C. Sanchez wrote:
> > It is not an error, but it is misleading to exit successfully.  If the
> > admin calls (or scripts a call to) `invoke-rc.d saslauthd start`, and
> > the daemon is not started, that really should exit with an error.
> > Please see #257181.
> 
> The submitter of the bug is on the right track in his explanation, but
> his proposed change is not consistent with his request or with the rest
> of the Debian system.
> 
> Also, it is not misleading to exit successfully in this case, because we
> are doing what the sysadmin has asked for, either implicitly by the
> package's default config, or explicitly by choosing a value for START.
> 
But it is misleading.  If the admin (or a script) issues a command to
start the daemon and the daemon does not start (either because it was
configured that way or because there was a problem), then it is an
error.

> To elaborate:
> Consider the purpose of the START variable. Why do we need it all all?
> 
> Answer:
> There are two typical kinds of daemon packages for Debian: those that
> imply that the daemon is in use (enabled, running) when the package is
> installed, and those that only provide the option of enabling the daemon
> at the sysadmin's discretion. The latter kind may default to running the
> daemon or to not running it.
> 
> In this case, the -bin package has other useful contents beside
> saslauthd, and that's why the START variable is used to record the
> sysadmin's decision on whether or not to run it. The variable is the
> "mode" of the initscript, the "start mode" or the "do nothing mode",
> where the latter gives the admin a pointer on how to move to "start
> mode".
> 
> The default is "no nothing mode", because we can't say that the most
> common case is to run saslauthd. A very typical setup doesn't use it at
> all, and with this version, use of saslauthd is likely to become even
> less common (because we SQL and LDAP auxprops). And the previous default
> was not to run it.
> 
> If you take a look at some other Debian packages, you'll see the same
> pattern:
> 
>       * apache2 has a NO_START variable. If set to 1, the initscript
>         will log a warning message and exit successfully.
>       * avahi-daemon has a AVAHI_DAEMON_START variable. If set to 0, the
>         initscript will do nothing at all (I would make it output a
>         message, but perhaps the maintainers feel that it's of little
>         use given the package in question) and exit successfully.
>       * bootlogd has a BOOTLOGD_ENABLE variable. If it starts with
>         "n" (as in "no"), then the initscript will be silent and exit
>         successfully.
>       * dbus has a ENABLED variable. If set to 0, the initscript will be
>         silent and exit successfully.
> 
> There are many other examples.
> 
> You don't have to take my word for it, though. Check other packages and
> ask experienced DDs.
> 
> If you want to argue that controlling whether or not to start daemons
> from config files in /etc/defaults when the package is already installed
> is confusing, then I can completely sympathise with that. The problem is
> that there are many cases where "package installed" == "daemon running"
> is not sufficiently fine-grained, so something else besides the
> installed / not installed status is needed, and that in turn leads us
> to /etc/defaults or a similar configuration scheme.
> 
I understand what you are saying.  

> > I'm not a big fan, especially of exiting successfully if saslauthd is not
> > started.  I have attached a patch with my proposed changes.
> 
> Your patch doesn't fall back to pam mech. But I noticed some mistakes in
> my patch as well, and there were some cases to improve, such as
> supporting stopping even if the user has set START!=yes after already
> starting the daemon with START set to yes.
> 
> Proposed patch attached.
> 
The patch looks better, but I still maintain that a non-zero exit code
is better when the daemon does not start.

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/20061021/16c41014/attachment.pgp


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