samba's package postinst script shouldn't return an error if samba daemon can't be started (e.g. if smb.conf file is incorrect or is removed)

Bug #85194 reported by jonaternet
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba (Baltix)
Invalid
Undecided
Unassigned
samba (Ubuntu)
Fix Released
Medium
Mathias Gug

Bug Description

since a recent update, every time I try to install packages or to upgrade :

jonaternet@jonaternet-desktop:~$ sudo apt-get upgrade
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture de l'information d'état... Fait
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
1 partiellement installés ou enlevés.
Il est nécessaire de prendre 0o dans les archives.
Après dépaquetage, 0o d'espace disque supplémentaires seront utilisés.
Souhaitez-vous continuer [O/n] ? o
Paramétrage de samba (3.0.22-1ubuntu4.1) ...
 * Starting Samba daemons... [fail]
invoke-rc.d: initscript samba, action "start" failed.
dpkg : erreur de traitement de samba (--configure) :
 le sous-processus post-installation script a retourné une erreur de sortie d'état 1
Des erreurs ont été rencontrées pendant l'exécution :
 samba
E: Sub-process /usr/bin/dpkg returned an error code (1)

Related branches

jonaternet (jonaternet)
description: updated
Revision history for this message
Mantas Kriaučiūnas (mantas) wrote : samba's package postinst script shouldn't return an error if samba daemon can't be started (for example if /etc/samba/smb.conf file is incorrect or is removed)

It seems the problem is in samba's package postinst script - it returns an error if samba daemon can't be started (for example if /etc/samba/smb.conf file is incorrect or is removed):

tomas@mazius:~$ sudo rm /etc/samba/smb.conf
tomas@mazius:~$ sudo dpkg -i /var/cache/apt/archives/samba_3.0.22-1ubuntu4.1_i386.deb
Selecting previously deselected package samba.
(Reading database ... 156493 files and directories currently installed.)
Unpacking samba (from .../samba_3.0.22-1ubuntu4.1_i386.deb) ...
Setting up samba (3.0.22-1ubuntu4.1) ...
Generating /etc/default/samba...
 * Starting Samba daemons... [fail]
invoke-rc.d: initscript samba, action "start" failed.
dpkg: error processing samba (--install):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 samba
tomas@mazius:~$

Solution is return only warning "Samba daemon can't be started, please check your samba configuration" instead of returning error exit status 1

Btw, /etc/samba/smb.conf file is the config file of another package - samba-common, so, AFAIK, we are not following to the packaging policy when postinst script assumes, that we should have correct config file from another package.

Revision history for this message
Henrik Nilsen Omma (henrik) wrote :

Hi. Thanks for reporting. I can confirm this still happens on gutsy.

Changed in samba:
importance: Undecided → Medium
status: New → Confirmed
Changed in samba:
status: New → Invalid
Soren Hansen (soren)
Changed in samba:
assignee: nobody → shawarma
status: Confirmed → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Not a showstopper, moving to tribe 4.

Revision history for this message
Martin Pitt (pitti) wrote :

Soren is on vac for a while and this is not a showstopper for tribe 4.

Mathias Gug (mathiaz)
Changed in samba:
assignee: shawarma → mathiaz
Revision history for this message
Mathias Gug (mathiaz) wrote :

I've attached a debdiff that fixes the problem.

Revision history for this message
Mathias Gug (mathiaz) wrote :

samba (3.0.25b-1ubuntu4) gutsy; urgency=low

  * debian/rules:
    - add error-handler=true to samba dh_installinit. Fixes LP: #85194.

 -- Mathias Gug <email address hidden> Fri, 17 Aug 2007 12:11:45 -0400

Changed in samba:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.