Ubuntu – samba not starting on ubuntu

sambaUbuntu

I have this output

 user123@Matrix-Server:~$ /etc/init.d/samba stop
    bash: /etc/init.d/samba: No such file or directory
    sputnik@Matrix-Server:~$ sudo /etc/init.d/samba restart
    sudo: /etc/init.d/samba: command not found
    user123@Matrix-Server:~$ 

 user123@Matrix-Server:~$ sudo apt-get install samba smbfs
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    samba is already the newest version.
    smbfs is already the newest version.
    The following packages were automatically installed and are no longer required:
      linux-headers-2.6.32-19-generic linux-headers-2.6.32-19
    Use 'apt-get autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Best Answer

Samba is composed of two separated daemons:

  • smbd which provides the file and printer sharing services
  • nmbd which provides the NetBIOS-to-IP-address name service

to restart completely samba you need to restart both of them so the correct sequence of commands is

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

or in a more "ubuntish" way

sudo service smbd restart
sudo service nmbd restart