samba-common fails to upgrade if smb.conf is deleted

Bug #312449 reported by Akdo on 2008-12-30
90
This bug affects 6 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Wishlist
Unassigned

Bug Description

Binary package hint: samba

this happen when smb.conf file not exist !

ProblemType: Package
Architecture: i386
DistroRelease: Ubuntu 8.10
ErrorMessage: subprocess post-installation script returned error exit status 1
NonfreeKernelModules: nvidia
Package: samba-common 2:3.2.3-1ubuntu3.3
SourcePackage: samba
Title: package samba-common 2:3.2.3-1ubuntu3.3 failed to install/upgrade: subprocess post-installation script returned error exit status 1
Uname: Linux 2.6.27-9-generic i686

Related branches

Akdo (menoft) wrote :
redintray (redintray) wrote :

Similar message received with 2:3.2.3-1ubuntu3.4

sudo dpkg --configure -a
Setting up samba-common (2:3.2.3-1ubuntu3.4) ...
Not replacing deleted config file /etc/samba/smb.conf
chmod: cannot access `/etc/samba/smb.conf': No such file or directory
dpkg: error processing samba-common (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of smbclient:
 smbclient depends on samba-common (= 2:3.2.3-1ubuntu3.4); however:
  Package samba-common is not configured yet.
dpkg: error processing smbclient (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpam-smbpass:
 libpam-smbpass depends on samba-common (= 2:3.2.3-1ubuntu3.4); however:
  Package samba-common is not configured yet.
dpkg: error processing libpam-smbpass (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of winbind:
 winbind depends on samba-common (= 2:3.2.3-1ubuntu3.4); however:
  Package samba-common is not configured yet.
dpkg: error processing winbind (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of smbfs:
 smbfs depends on samba-common (= 2:3.2.3-1ubuntu3.4); however:
  Package samba-common is not configured yet.
dpkg: error processing smbfs (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 samba-common
 smbclient
 libpam-smbpass
 winbind
 smbfs

Copying smb.conf from a backup resolved problem, but I would have prefered that the upgrade process coped with the file being missing, by recreating the default smb.conf file.

Thierry Carrez (ttx) wrote :

Yes, the following in samba-common.postinst:
  ucf --three-way --debconf-ok "$NEWFILE" "$CONFIG"
  ucfr samba-common "$CONFIG"
  chmod a+r "$CONFIG"
results in:
  Not replacing deleted config file /etc/samba/smb.conf
  chmod: cannot access `/etc/samba/smb.conf': No such file or directory

If the file is deleted, it should probably reinstall a pristine version, rather than just "Not replacing" it and letting chmod fail :)

It's still something that shouldn't happen (/etc conffiles should be removed by purge, not manually) but given the number of updates that fail for this reason a more graceful handling of this corner case is definitely wanted.

Changed in samba:
importance: Undecided → Medium
status: New → Confirmed
Thierry Carrez (ttx) wrote :

Proposed patch

How to reproduce:
$ sudo apt-get install samba
$ sudo apt-get remove samba
$ sudo apt-get autoremove
$ sudo rm -rf /etc/samba
$ sudo apt-get install samba

Thierry Carrez (ttx) wrote :

Refreshed debdiff that builds on recent 3.3.1-1ubuntu1 release

Thierry Carrez (ttx) wrote :

slangasek once said:
"the reasons for not regenerating the config file whenever it's missing or empty are rooted in the Debian and Ubuntu policy on config files, and this can't be changed without causing more problems than it solves."

so we should rather have a more informative error message. Something like:
Not replacing deleted config file /etc/samba/smb.conf
Install/upgrade will fail. To recover, please try:
  sudo cp /usr/share/samba/smb.conf /etc/samba/smb.conf
  sudo dpkg --configure -a

Changed in samba:
importance: Medium → Wishlist
Thierry Carrez (ttx) on 2009-03-23
Changed in samba:
assignee: nobody → ttx
status: Confirmed → In Progress
Thierry Carrez (ttx) wrote :

Proposed patch

samba (2:3.3.1-1ubuntu2) jaunty; urgency=low

  * debian/samba-common.postinst: Avoid upgrade/reinstall failure if
    smb.conf was manually deleted (LP: #312449)

 -- Thierry Carrez <xxx> Wed, 04 Mar 2009 10:42:55 +0000

Changed in samba:
assignee: ttx → nobody
status: In Progress → Confirmed
Thierry Carrez (ttx) wrote :

Hm, wrong changelog entry (debdiff is ok). This should read:

samba (2:3.3.2-1ubuntu2) jaunty; urgency=low

  * debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted (LP: #312449)

 -- Thierry Carrez <xxx> Mon, 23 Mar 2009 15:11:08 +0100

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package samba - 2:3.3.2-1ubuntu3

---------------
samba (2:3.3.2-1ubuntu3) jaunty; urgency=low

  [Thierry Carrez]
  * debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted (LP: #312449)

  [Chuck Short]
  * debian/control: Add suggests keyutils for smbfs. (LP: #300221)

 -- Chuck Short <email address hidden> Fri, 27 Mar 2009 10:46:15 -0400

Changed in samba:
status: Confirmed → Fix Released
Dr_ITGuy (bluscreenofdeath) wrote :

Not sure if related, but samba crashed for me after uninstalling and reinstalling. During reinstallation, I'm prompted to decide what to do with the existing smb.conf. I make a choice (use package maintainer's version) and subsequently it crashes, both after making this choice, and when rebooting. Have not taken the time to research a solution yet. Will try a default smb.conf from other machine first.

arnavak (arnavak) wrote :

Hello
I do not use samba, only NFS. So i uninstalled Samba. So The Bug.
I Have to unactivate the samba upgrade proposition...

Thanks for comments

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers