1

On Ubuntu 18.04 whenever I do apt upgrade (even if no packages to upgrade):

root@JohnPC:/home/john# apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up samba (2:4.7.6+dfsg~ubuntu-0ubuntu2.2) 

...

Samba is not being run as an AD Domain Controller.
Please ignore the following error about deb-systemd-helper not finding samba-ad-dc.service.
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 "restart" failed.
● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-08-17 08:13:54 BST; 27ms ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 28404 ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS (code=exited, status=1/FAILURE)
 Main PID: 28404 (code=exited, status=1/FAILURE)

Aug 17 08:13:54 JohnPC systemd[1]: Starting Samba SMB Daemon...
Aug 17 08:13:54 JohnPC systemd[1]: smbd.service: Main process exited, code=exited, status=1/FAILURE
Aug 17 08:13:54 JohnPC systemd[1]: smbd.service: Failed with result 'exit-code'.
Aug 17 08:13:54 JohnPC systemd[1]: Failed to start Samba SMB Daemon.
dpkg: error processing package samba (--configure):
 installed samba package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Errors were encountered while processing:
 samba
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@JohnPC:/home/john# systemctl status smbd.service
● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-08-17 08:13:54 BST; 43s ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 28404 ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS (code=exited, st
 Main PID: 28404 (code=exited, status=1/FAILURE)

Aug 17 08:13:54 JohnPC systemd[1]: Starting Samba SMB Daemon...
Aug 17 08:13:54 JohnPC systemd[1]: smbd.service: Main process exited, code=exited, status=1/FAILURE
Aug 17 08:13:54 JohnPC systemd[1]: smbd.service: Failed with result 'exit-code'.
Aug 17 08:13:54 JohnPC systemd[1]: Failed to start Samba SMB Daemon.
  • anything of note in /var/log/syslog ? – Dan Aug 17 '18 at 9:54
  • Could you please edit your question to include the output of sudo journalctl -lxeu smbd.service? Thanks. – David Foerster Aug 17 '18 at 10:18
  • Can't show all of journalct command as too long for Comment. john@JohnPC:~$ sudo journalctl -lxeu smbd.service [sudo] password for john: -- Subject: Unit smbd.service has failed -- Defined-By: systemd -- Support: ubuntu.com/support -- -- Unit smbd.service has failed. -- -- The result is RESULT. – John Rose Aug 17 '18 at 14:10
  • /var/log/syslog only has entries for kernel's UFW rejections e.g. Aug 17 00:06:49 JohnPC kernel: [138367.824026] [UFW AUDIT] IN=enp3s0 OUT= MAC=b8:ae:ed:7a:6e:24:b0:7f:b9:14:cb:88:08:00 SRC=162.125.18.133 DST=192.168.101.12 LEN=52 TOS=0x00 PREC=0x00 TTL=52 ID=49907 PROTO=TCP SPT=443 DPT=50190 WINDOW=360 RES=0x00 ACK URGP=0 – John Rose Aug 17 '18 at 14:12
3

Open a terminal and run the following command:

testparm -s

Do you get the following error:

WARNING: Ignoring invalid value 'share' for parameter 'security'
Error loading services.

If you do edit /etc/samba/smb.conf, find the line "security = share", and delete it. Then rerun systemctl status smbd.service.

It could be another parameter that is the culprit but that is the most common. In all cases testparm should give you a hint to the offending parameter and end with the "Error loading services" error.

EDIT: If you have no smb.conf at /etc/samba but have one at /usr/share/samba then copy that one to the standard location:

sudo cp /usr/share/samba/smb.conf /etc/samba

Run "testparm -s" again to make sure it's happy.

| improve this answer | |
  • Running testparm gave: john@JohnPC:~$ testparm -s Load smb config files from /etc/samba/smb.conf rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) Error loading services. There is no file named /etc/samba/smb.conf – John Rose Aug 17 '18 at 12:29
  • Do you have a smb.conf at /usr/share/samba/smb.conf? If you do see my edit above. – Morbius1 Aug 17 '18 at 18:53
  • Directory /etc/samba is empty: therefore no /usr/share/smb.conf. Could this be due to my 'apt purge samba' followed by 'apt install samba', which was advised by someone on another web site. I have 3 files (smb.conf, gdbcommands and smbusers) in /etc/samba on a Ubuntu 16.04 PC. So would it be a good idea to copy them over to my 18.04 machine? – John Rose Aug 18 '18 at 6:28
  • Directory /etc/samba is empty: therefore no /usr/share/smb.conf. I did 'sudo cp /usr/share//samba/smb.conf /etc/samba' followed by 'apt upgrade' and things improved but got: W: APT had planned for dpkg to do more than it reported back (3 vs 7). Affected packages: samba:amd64 Is there a fix for this? BTW I noticed that on another (16.04) PC that there are 2 other files in /etc/samba: gdbcommands & smbusers. Is that significant? – John Rose Aug 18 '18 at 6:41
  • 'testparm -s' gave: Load smb config files from /etc/samba/smb.conf rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) WARNING: The "syslog" option is deprecated Processing section "[printers]" Processing section "[print$]" Loaded services file OK. Server role: ROLE_STANDALONE plus a number of parameter values. – John Rose Aug 18 '18 at 8:01
1

Same problem over here. The nmbd-logfile complaint about some problems with netbios on ipv6. So I checked smb.conf and at [globals] I found that the interface was bound to 'eth*' but my interface name is 'enp0s31f6'. After changing this smbd and nmbd started both fine. Also my 'apt-get upgrade' problem was gone :)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.