can not restart samba

26,586

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
Share:
26,586

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    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
    Frank Nocke almost 8 years
    as 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
    Rinzwind almost 8 years
    16.04 uses systemd so you need the equivalent for samba using systemctl. Likely systemctl start/stop/restart samba.
  • Frank Nocke
    Frank Nocke almost 8 years
    No samba, no smbd to be found. systemctl list-unit-files | grep ... and grepping for sm and sa reveals nothing relevant. (Though samba shares do work for me! Just want to deal with a changed smb.conf)
  • Rinzwind
    Rinzwind almost 8 years
    typo. it is smdb :)
  • Frank Nocke
    Frank Nocke almost 8 years
    No luck with nothing :-/ sudo systemctl restart smdb.service - Failed to restart smdb.service: Unit smdb.service not found.
  • Rinzwind
    Rinzwind almost 8 years
    It 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
    Frank Nocke almost 8 years
    Also 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...