7

I have upgraded smoothly to 16.04, everything seems ok except samba not starting:

$ sudo /etc/init.d/smbd status
● smbd.service - LSB: start Samba SMB/CIFS daemon (smbd)
   Loaded: loaded (/etc/init.d/smbd; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2016-04-25 21:43:03 EET; 23min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1954 ExecStart=/etc/init.d/smbd start (code=exited, status=1/FAILURE)

Apr 25 21:43:02 home systemd[1]: Starting LSB: start Samba SMB/CIFS daemon (smbd)...
Apr 25 21:43:03 home smbd[1954]:  * Starting SMB/CIFS daemon smbd
Apr 25 21:43:03 home smbd[1954]:    ...fail!
Apr 25 21:43:03 home systemd[1]: smbd.service: Control process exited, code=exited status=1
Apr 25 21:43:03 home systemd[1]: Failed to start LSB: start Samba SMB/CIFS daemon (smbd).
Apr 25 21:43:03 home systemd[1]: smbd.service: Unit entered failed state.
Apr 25 21:43:03 home systemd[1]: smbd.service: Failed with result 'exit-code'.

I did not alter any configuration after the upgrade, I just need to maintain the 15.10 functionalities. I have done several reboots with no luck.

Update1: I purged samba and tried to re-install, but got the following error:

Errors were encountered while processing:
 samba
E: Sub-process /usr/bin/dpkg returned an error code (1)
Failed to perform requested operation on package.  Trying to recover:
Setting up samba (2:4.3.8+dfsg-0ubuntu1) ...
Job for smbd.service failed because the control process exited with error code. See "systemctl status smbd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript smbd, action "start" failed.
dpkg: error processing package samba (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Errors were encountered while processing:
 samba

Looks like the 16.04 package has a bad post-installation script?

Any tips/tricks are appreciated.

1
  • The 16.04 version is 2:4.3.8+dfsg-0ubuntu1 Apr 25, 2016 at 20:21

3 Answers 3

7

Removing security = share from my personal smb.conf without reinstalling, and running systemctl restart smbd.service, fixed the problem for me.

3
  • No, OP's issue is clearly related to package management, not Samba configuration. -1 Oct 1, 2016 at 12:13
  • 5
    It's not a package management issue. The 'security = share' is the issue. The "package management" error is actually an error caused by samba not starting up during the configuration phase of the install, due to this configuration change. Doing a --purge reinstall only fixes the same issue in a different way. Oct 19, 2016 at 16:25
  • +1 Although this might originally have been intended as a comment on lattimore's answer (which, in turn, might have been based on carl's comment), of all the answers or comments here that mention this technique this is the only one that explains specifically how to do it, including what command to use to restart the service. Sep 13, 2017 at 4:36
4

I had the exact problem after upgrading to 16.04, first showed many errors as yours, something like:

dpkg: error processing package samba (--configure)

After I changed software sources to ubuntu main server, I can reinstall samba and the following commands without error:

sudo /etc/init.d/smbd status
sudo apt-get install libnss-winbind* libpam-winbind* samba* winbind*

Because the uninstall of samba was --purge, my old smb.conf was removed, it generated a new one, I think after I edit it, it won't be a problem.

3
  • When I replaced the new smb.conf with and old backup copy, then restart samba service, it got error again, said:
    – carl
    Apr 26, 2016 at 18:11
  • 1
    When I replaced the new smb.conf with an old backup copy, then restart samba service, it got error again, said: Failed to start LSB: start Samba SMB/CIFS daemon (smb. Then I checked step by step, I found out because my old smb.conf backup file has such lines ( security = share username map = /etc/samba/smbusers) to cause the error, seems new version of smb.conf abandons this 2 commands.
    – carl
    Apr 26, 2016 at 18:18
  • 4
    yes, removing security = share and reinstalling fixed the problem. Many thanks. Apr 26, 2016 at 23:14
2

I got the same problem. Comment this line security = share. And restarted smdb service and it works well again.

1
  • 1
    It's not a package management issue. The 'security = share' is the issue. The "package management" error is actually an error caused by samba not starting up during the configuration phase of the install, due to this configuration change. Doing a --purge reinstall only fixes the same issue in a different way. Oct 19, 2016 at 16:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .