13

I want to tweak smb.conf without causing network hiccups for folks who rely on our samba4 fileshare.

I made an obvious path change that should only affect my own private share, and ran smbcontrol smbd reload-config. It didn't complain, but didn't affect my share, either. I also tried smbcontrol samba4 reload-config, which returned Can't find pid for destination 'samba4', so I tried without the '4', and it had the same no-change behaviour as smbd.

Is there a way to reload the conf in Samba 4 without closing open files and the like?

Kev
  • 1,729
  • 4
  • 27
  • 47

2 Answers2

27

Use this: smbcontrol all reload-config

Force daemon to reload smb.conf configuration file. Can be sent to smbd, nmbd, or winbindd. The all destination causes the message to "broadcast" to all running daemons including nmbd and winbind.

KeyszerS
  • 103
  • 4
Gerson Ramirez
  • 371
  • 3
  • 2
  • 1
    Good, but more detailed answers are better. – peterh May 20 '18 at 02:09
  • sorry, I have bad english :) – Gerson Ramirez May 20 '18 at 14:15
  • I think peterh means: Why is "all" the answer? Which component is needed besides smbd or samba4? (Then we can target it instead of restarting all services, which may not be desirable.) – Kev May 22 '18 at 08:39
  • 2
    the command show "reload" not restart... Needs eyeglasses :D You can use it as you like all, smbd a nmbd or a winbindd.read the samba documentation in the find the examples https://www.samba.org/samba/docs/current/man-html/smbcontrol.1.html – Gerson Ramirez May 23 '18 at 15:38
7

You can try with sending SIGHUP signal to smbd process

killall -HUP smbd nmbd

NOTE: Be careful using killall on Unix. Running killall on Solaris on root would send kill signals to all processes! [en.wikipedia.org/wiki/Killall]

Rahul Patil
  • 24,281
  • 25
  • 80
  • 96
  • smbd isn't used on samba4 – Kev Jul 15 '14 at 20:55
  • and this would restart the service and boot everyone, wouldn't it? – Kev Jul 15 '14 at 20:56
  • 1
    Signal HUP only will reload configuration,not fully stop and start. to enable at boot, you need to use `update-rc.d servicename defaults`. and yes in samba4 service name is `/usr/local/samba/sbin/samba`, if you are using compiled version then you can use init script from this link > https://github.com/rahulinux/samba4 – Rahul Patil Jul 16 '14 at 05:14
  • 2
    Be careful using `killall` on Unix. Running `killall` on Solaris on root would send kill signals to *all* processes! [https://en.wikipedia.org/wiki/Killall] – donothingsuccessfully Nov 30 '15 at 14:38
  • @donothingsuccessfully thanks.. updated.. – Rahul Patil Nov 30 '15 at 16:23
  • 1
    `smbd` is used on Samba 4.1 on Debian Jessie. Maybe that is distribution dependent. – mivk Jan 25 '16 at 14:46