2

I installed Samba, and edited smb.conf. Then I typed the following:

sudo /etc/init.d/samba restart

The response I got was

sudo: /etc/init.d/samba: command not found

So now what?

Edit: If I do sudo /etc/init.d/smbd restart, I get the following message:

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 restart(8) utility, e.g. restart smbd smbd start/running, process 9265

2
  • see my updated answer!
    – Pylsa
    Commented Aug 15, 2010 at 18:43
  • /etc/init.d/samba restart works very well on 9.10. I just had the issue, and it came with the upgrade to 10.04. It just changed to smbd.
    – Quandary
    Commented Nov 14, 2010 at 20:41

3 Answers 3

2

Use:

$ sudo su
# /etc/init.d/samba restart

and let me know if that works...

UPDATE

Then try the following:

$ sudo restart smbd
1
  • It says bash: /etc/init.d/samba: No such file or directory
    – tony_sid
    Commented Aug 15, 2010 at 18:29
1

There are no /etc/init.d/samba initscript in the samba package; use sudo /etc/init.d/smbd restart instead.

3
  • Odd... sudo /etc/init.d/samba restart works with me...
    – Pylsa
    Commented Aug 15, 2010 at 18:15
  • When I tried that I got a message, which I posted in the original question.
    – tony_sid
    Commented Aug 15, 2010 at 18:30
  • @awakeFromNib: first, even through it printed the message, the script actually ran. Second, if you don't want to see it, just use sudo restart smbd.
    – Catherine
    Commented Aug 15, 2010 at 19:18
0

update for who using Raspberry Pi

  1. samba command not found
$ sudo /etc/init.d/samba restart
sudo: /etc/init.d/samba: command not found
  1. find out the new service name of samba
$ ls -al /etc/init.d/ | grep -E "\ss"
-rwxr-xr-x   1 root root 2259 Aug  1  2022 samba-ad-dc
-rwxr-xr-x   1 root root 2224 Apr 15  2018 saned
-rwxr-xr-x   1 root root 2061 Aug  1  2022 smbd
-rwxr-xr-x   1 root root 4056 Jul  2  2022 ssh
-rwxr-xr-x   1 root root 1030 Jan 14  2023 sudo
  1. restart smbd service
$ sudo /etc/init.d/smbd restart
Restarting smbd (via systemctl): smbd.service.

# OR
$ sudo systemctl restart smbd
# OR
$ sudo systemctl restart smbd.service

screenshot

enter image description here

refs

https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .