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
Related videos on Youtube
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on September 18, 2022Comments
-
Admin almost 2 years
I installed samba
sudo apt-get install samba
.then I made configuration but when i write :
sudo /etc/init.d/samba restart message appears " command not found "
and when I write
ls /etc/init.d
I didn't find samba .solutions tested :
sudo /etc/init.d/smbd restart sudo /etc/init.d/nmbd restart sudo service samba restart
and re-install samba
can you hint me please .
note : my os is ubuntu10.4 LTS
-
Frank Nocke almost 8 yearsas of Ubuntu 16.04 no such thing as /etc/init.d/smbd (and I do have working samba shares... or is it cifs, and hence... ?)
-
Rinzwind almost 8 years16.04 uses systemd so you need the equivalent for samba using
systemctl
. Likelysystemctl start/stop/restart samba
. -
Frank Nocke almost 8 yearsNo
samba
, nosmbd
to be found.systemctl list-unit-files | grep ...
and grepping forsm
andsa
reveals nothing relevant. (Though samba shares do work for me! Just want to deal with a changed smb.conf) -
Rinzwind almost 8 yearstypo. it is smdb :)
-
Frank Nocke almost 8 yearsNo luck with nothing :-/
sudo systemctl restart smdb.service
-Failed to restart smdb.service: Unit smdb.service not found.
-
Rinzwind almost 8 yearsIt is the correct command, You need to investigate why it fails. It also should tell you "See 'systemctl status smbd.service' and 'journalctl -xn' for details" ;-)
-
Frank Nocke almost 8 yearsAlso after correting smbd to smdb again ;-) I get
systemctl status smdb.service | ● smdb.service, Loaded: not-found (Reason: No such file or directory)| Active: inactive (dead)
— I start suspecting, Ubuntu 16 somehow integrated samba services elsewhere. This would also explain, why certain smb.conf changes change nothing, even after reboot don't work as expected, despite the share service itself perfectly working...