2

I have samba server that constantly reloads each ~2min for some reason:

$ sudo systemctl status smbd
● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-05-03 11:30:26 EDT; 19h ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 14071 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
 Main PID: 927 (smbd)
   Status: "smbd: ready to serve connections..."
    Tasks: 5 (limit: 4346)
   Memory: 17.6M
   CGroup: /system.slice/smbd.service
           ├─ 927 /usr/sbin/smbd --foreground --no-process-group
           ├─ 940 /usr/sbin/smbd --foreground --no-process-group
           ├─ 942 /usr/sbin/smbd --foreground --no-process-group
           ├─ 967 /usr/sbin/smbd --foreground --no-process-group
           └─1535 /usr/sbin/smbd --foreground --no-process-group

May 04 06:32:38 router systemd[1]: Reloading Samba SMB Daemon.
May 04 06:32:38 router systemd[1]: Reloaded Samba SMB Daemon.
May 04 06:34:36 router systemd[1]: Reloading Samba SMB Daemon.
May 04 06:34:36 router systemd[1]: Reloaded Samba SMB Daemon.
May 04 06:37:07 router systemd[1]: Reloading Samba SMB Daemon.
May 04 06:37:07 router systemd[1]: Reloaded Samba SMB Daemon.
May 04 06:39:19 router systemd[1]: Reloading Samba SMB Daemon.
May 04 06:39:19 router systemd[1]: Reloaded Samba SMB Daemon.
May 04 06:41:39 router systemd[1]: Reloading Samba SMB Daemon.
May 04 06:41:39 router systemd[1]: Reloaded Samba SMB Daemon.

Where should I look to understand why systemd reloads this unit?

1 Answer 1

2

I've run into this after upgrading a Ubuntu system from 18.04 to 20.04

I noticed in the full systemd journal, smbd got reloaded after every dhcp lease renewal (in my case, approximately once an hour)

Aug 20 08:38:54 fileserver dhclient[282]: DHCPREQUEST for 10.12.24.115 on eth0 to 10.12.24.1 port 67 (xid=0x5d719a99)
Aug 20 08:38:54 fileserver dhclient[282]: DHCPACK of 10.12.24.115 from 10.12.24.1 (xid=0x999a715d)
Aug 20 08:38:54 fileserver systemd[1]: Reloading Samba SMB Daemon.
Aug 20 08:38:54 fileserver systemd[1]: Reloaded Samba SMB Daemon.

Some extra googling lead me to https://superuser.com/questions/1289485/samba-reload-on-new-dhcp-lease & /etc/dhcp/dhclient-enter-hooks.d/samba, which reloads the service.

I've checked my backups and this file existed previously for 18.04.

Therefore, the "issue" probably lies with systemd-networkd, which is the network daemon in 20.04.

My own investigation continues, but I hope that helps...

1
  • Yes, find out that this reloads somehow connected with dhcp leases, but my question is about "how in general find out why systemd reloads unit" Commented Aug 20, 2021 at 12:31

You must log in to answer this question.

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