[Pkg-samba-maint] Bug#451269: Bug#451269: samba's package postinst script shouldn't return an error if samba daemon can't be started

Mathias Gug mathiaz at ubuntu.com
Wed Nov 14 23:41:43 UTC 2007


Hi Steve,

On Wed, Nov 14, 2007 at 02:59:58PM -0800, Steve Langasek wrote:
> > If the samba configuration is broken, the postinst script fails. I've attached
> > a patch that add true as the error-handler when restarting samba.
> 
> > First reported in Ubuntu:
> > https://bugs.launchpad.net/ubuntu/+source/samba/+bug/85194
> 
> > -	DH_OPTIONS= dh_installinit -psamba -- "defaults 20 19"
> > +	DH_OPTIONS= dh_installinit -psamba --error-handler=true -- "defaults 20 19"
> >  	DH_OPTIONS= dh_installinit -pwinbind
> >  	dh_installcron 
> >  	for pkg in samba smbfs winbind; do \
> 
> This doesn't look like correct behavior to me.  Conceptually, I don't
> believe that packages should declare themselves to be "configured" when
> their config is left in a detectably broken state; I think this should be
> handled through the packaging system itself rather than having the packaging
> system declare the package "ok" and leave the admin to detect the problem
> out of band.
> 
> Yes, it can be a problem for apt when packages fail to configure; but why is
> the samba package's configuration broken in the first place?

I think the use case would be that the user broke the configuration
file. For example, there is a recurring bug on Kubuntu where the kde
network administration tool inserts a broken entry in smb.conf (it adds
a "dfs proxy = no" line for each share it defines).

It's true that the problem is not the samba package itself, but the idea
is to make the post installation script more robust to
mis-configuration (in the same vein as don't restart apache if the
configuration is broken).

> 
> The argument given in the Ubuntu bug report, that "we are not following the
> packaging policy when the postinst assumes that we should have a correct
> config file from another package", is false; samba and samba-common are
> cooperating packages, and one of the main purposes of the samba-common
> package is to manage the smb.conf file on behalf of samba.  But of course
> samba-common doesn't contain enough information to ascertain for itself that
> the config on disk is usable by smbd, so it's up to the samba package to
> complain when this is not the case.
> 
> Do you disagree with this position?
>

No.

> I would in any case be interested to know for sure why the original bug
> submitter had an smbd that wouldn't start; the follow-up from Mantas is
> fairly speculative about the cause of the failure, it's entirely possible
> that this change has only papered over whatever the original submitter's
> problem was.

Yes that's probably true. Again my aim was to make the package more
robust to mis-configuration. OTOH if the configuration is broken we need
a way to tell the user that there is a problem.

--
Mathias





More information about the Pkg-samba-maint mailing list