Skip to content

Instantly share code, notes, and snippets.

@atomize
Created March 9, 2017 19:26
Show Gist options
  • Save atomize/e16daa2c09b7d6cf560bbd9649162998 to your computer and use it in GitHub Desktop.
Save atomize/e16daa2c09b7d6cf560bbd9649162998 to your computer and use it in GitHub Desktop.
Graceful samba reload to recognize changes to smb.conf without restart, as root:
#RUN AS ROOT
# To get samba to recognize changes to its smb.conf *without restart*, as root:
# 1) First test your configuration file for errors:
testparm /path/to/smb.conf; echo $?
#If it exits '0' you're good to go.
# 2) Find the parent SMBD
ps -ef | grep smbd
#In the list find the process parented by Init, or process 1.
#This is the parent smbd daemon to the other servicing children.
#) Issue that pid a SIGHUP:
kill -1 <yourPID>
#Done. This is regularly performed and confirmed to work without interruption a Samba cluster hosting thousands of clients.
# src: https://ubuntuforums.org/showthread.php?t=903896
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment