126

Sorry this is a little embarassing but I'm trying to set up my own server for the first time. I found great tutorial online.

http://www.intac.net/build-your-own-server/

I'm stuck at the 2nd to last line of step 4. Apparently there is no samba directory in init.d.

Why isn't there a samba directory in init.d?

Would the following work?

# sudo restart smbd
# sudo restart nmdb
Braiam
  • 66,947
  • 30
  • 177
  • 264
user784637
  • 10,705
  • 19
  • 53
  • 56
  • 1
    If your `#` means you are logged in as superuser, then you don't need to run the commands with `sudo`, else the commands you mentioned are fine. – htorque Feb 05 '12 at 12:10
  • 1
    If you're embarrassed as a first timer, what does that make me when I've had a server running for years and needed this question :) – Sridhar Sarnobat Dec 18 '16 at 06:40
  • perhaps service samba-ad-dc restart? – Jabin Aug 29 '22 at 12:21
  • `samba-ad-dc.service` is the Samba Active Directory / Domain Controller service, which is not enabled by default. So this unfortunately is not an answer to the question. – Artur Meinild Aug 30 '22 at 07:07

5 Answers5

186

Start

sudo service smbd start

Stop

sudo service smbd stop

Restart

sudo service smbd restart
Bruno Pereira
  • 72,895
  • 33
  • 199
  • 223
20

Starting with 15.04 and systemd, the command is systemctl restart smbd

mirh
  • 364
  • 2
  • 11
  • 4
    the service is smbd, not smdb – fireb86 Mar 11 '18 at 15:01
  • +1 for updating an old question. But [Ubuntu 15.04 was first version to use systemd](https://www.pcworld.com/article/2895517/ubuntu-just-switched-to-systemd-the-project-sparking-controversy-throughout-linux.html). – WinEunuuchs2Unix Mar 11 '18 at 21:41
  • Duh. Info online is so.. contradicting. I guess like it might be because back then it [hadn't be](https://bugs.launchpad.net/ubuntu/+source/ubuntu-meta/+bug/1427654) a totally full 100% switch. – mirh Mar 13 '18 at 17:30
  • Is there any significant difference compared to "sudo service smbd xxx"? – Silicomancer Oct 02 '20 at 19:29
  • Yes, a total one? Service is a command for System V systems afaik. – mirh Oct 03 '20 at 00:22
16

You can also do this way:

Start

sudo /etc/init.d/smbd start

Stop

sudo /etc/init.d/smbd stop

Restart

sudo /etc/init.d/smbd restart

If you got an error, try using these commends this nmbd instead.

One Zero
  • 26,773
  • 26
  • 87
  • 109
11

you may also try this :

check the name of the service:

service --status-all

restart the service

sudo service samba restart
Seth
  • 57,282
  • 43
  • 144
  • 200
derdonn
  • 111
  • 1
  • 2
1

On RHEL you start smb and nmb:

systemctl start smb
systemctl start nmb

Next, check if they started:

ps -elf | grep smbd
ps -elf | grep nmbd
Darrin
  • 111
  • 1