Stopping and Starting the Samba Daemons
Samba runs a couple of processes in the background: notably the Samba and NetBIOS daemons.
You can check to see if the Samba daemon (smbd) is running using the ps command:
$ ps -ef | grep smbd
root 3869 1 0 16:41 ? 00:00:00 smbd -F
root 3881 3869 0 16:41 ? 00:00:00 smbd -F
fredb 3944 3052 0 16:47 pts/0 00:00:00 grep --color=auto smbd
You can also check to see if the NetBIOS name server daemon (nmbd) is running using the ps command:
$ ps -ef | grep nmbd
root 1964 1 0 08:59 ? 00:00:00 nmbd -D
fredb 8076 4453 0 18:09 pts/0 00:00:00 grep --color=auto nmbd
If any process (-apart from the grep command itself) is returned, then the process is running.
If you need to stop the smbd or nmbd daemon, you can use the following commands:
$ sudo service smbd stop
$ sudo service nmbd stop
If you need to forcibly stop the smbd or nmbd daemon, you can use the following command (-you'll need to give them some time to shut down):
sudo kill -15 <smbd PID>
sudo kill -15
Note: only use sudo kill -9 as a last resort - as this may leave shared memory in an inconsistent state
If you need to start the smbd or nmbd daemon, you can use the following commands:
$ sudo service smbd start
$ sudo service nmbd start
Note: there is also a restart option if you need to restart the daemon after changing the Samba configuration files!