can not restart samba

Solution 1:

sudo /etc/init.d/smbd restart

Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service smbd restart

Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the stop(8) and then start(8) utilities, e.g. stop smbd ; start smbd. The restart(8) utility is also available.

smbd stop/waiting

smbd start/running, process 7831

So the commands to start/stop samba:

sudo stop smbd
sudo start smbd

For systemd related systems (ie. Ubuntu 16.04):

systemctl start smbd.service
systemctl stop smbd.service

Solution 2:

if you have installted samba package. you can find smbd, nmbd in the folder(/etc/init.d)

if not, it mean that your installation failed.

if yes, you can start the service via --

sudo /etc/init.d/smbd start
sudo /etc/init.d/nmbd start

or

sudo service smbd start
sudo service nmbd start