5

I attempting to set up a samba server on an ubuntu server (18.04). I needed to compile from sources since I need special support for Mac OS and time machine is which is available only in versions 4.8 or above.

I tried installing 4.9.2 and followed the instructions here with the exception that I needed to disable LDAP and AD support for configure. The build and install went fine so I copied the systemctl files into place and tried to start everything.

super@fulton:~/samba/samba-samba-4.9.2$ sudo systemctl start {nmb,smb,winbind}.service
Job for nmb.service failed because a timeout was exceeded.
See "systemctl status nmb.service" and "journalctl -xe" for details.
Job for winbind.service failed because a timeout was exceeded.
See "systemctl status winbind.service" and "journalctl -xe" for details.
Job for smb.service failed because a timeout was exceeded.
See "systemctl status smb.service" and "journalctl -xe" for details.

status gives:

● smb.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smb.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Thu 2019-01-31 14:46:34 NZDT; 13min ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 12343 ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS (code=killed, signal=TERM)
 Main PID: 12343 (code=killed, signal=TERM)

Jan 31 14:45:04 fulton.geek.nz systemd[1]: Starting Samba SMB Daemon...
Jan 31 14:46:34 fulton.geek.nz systemd[1]: smb.service: Start operation timed out. Terminating.
Jan 31 14:46:34 fulton.geek.nz systemd[1]: smb.service: Failed with result 'timeout'.
Jan 31 14:46:34 fulton.geek.nz systemd[1]: Failed to start Samba SMB Daemon.

But /var/log/samba/log.smbd suggests that the services started.

[2019/01/31 14:45:04.465362,  0] ../lib/util/become_daemon.c:138(daemon_ready)
  daemon_ready: STATUS=daemon 'smbd' finished starting up and ready to serve connections

so it looks as if there is something wrong with the systemd script and it is killing off the process when it does not get some expected response.

Any ideas what to look for?

update: I was successfully able to start smbd from the command line and attach to shared which suggest that there is an issue with the systemd script. I note that smbd is invoked with the --foreground is this correct? I guess systemd intends to background the process itself so it can manage it?

here is the config:

[Unit]
Description=Samba SMB Daemon
Documentation=man:smbd(8) man:samba(7) man:smb.conf(5)
Wants=network-online.target
After=network.target network-online.target nmb.service winbind.service

[Service]
Type=notify
NotifyAccess=all
PIDFile=/var/run/samba/smbd.pid
LimitNOFILE=16384
EnvironmentFile=-/etc/sysconfig/samba
ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS
ExecReload=/bin/kill -HUP $MAINPID
LimitCORE=infinity

[Install]
WantedBy=multi-user.target

3 Answers 3

9

I ran into this when trying to get different types of machines running the latest version of Samba for time machine use as well.

One solution is to change the Type=notify to Type=simple. There is something about the new versions of Samba not playing nice with the way systemd handles process communication.

-Type=notify
+Type=simple

Then run systemctl daemon-reload and try to start er up again.

7

The following worked for me:

  1. Run the following command to edit samba settings:

     sudo vi /etc/samba/smb.conf
    
  2. press a key one time (This is used to enable editing mode on vi)

  3. Comment (add a hashtag (#) at the start of the line) interfaces = x.x.x.x/x

  4. Comment also bind interfaces only = x

It should look like these now:

#    interfaces = x.x.x.x/x
# There is some info text
#    bind interfaces only = x
  1. Press ESC and then type :wq and press intro (If you used nano, you should press Ctrl+O and then Ctrl+X).

  2. Reload the samba service running:

     sudo systemctl restart nmbd
    
  3. Now, we are going to check if it worked. Run the following command:

     systemctl status nmbd.service
    
  4. The terminal should now print active(running) in green

1

No longer an issue after deleting all systemd files. The issue may be that you have a systemd file from an older install of samba. Those will need to be deleted. In 4.10.10, it does not come with a systemd file, they get autogenerated from /etc/init.d/smbd. Check the output it should say this:

-> % sudo systemctl status smbd.service                                                             
● smbd.service - LSB: Samba SMB/CIFS daemon (smbd)
   Loaded: loaded (/etc/init.d/smbd; generated)

You must log in to answer this question.

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