First, I am connecting to a Red Hat machine which is identified from the following:

cat /proc/version
Linux version 4.2.2-1.el7.elrepo.x86_64 (mockbuild@Build64R7) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Wed Sep 30 15:08:55 EDT 2015

I had modified the /etc/samba/smb.conf to include the directory which I want to share. In the past I would issue the following to restart the service

sudo service smbd restart

But I receive the following message

Redirecting to /bin/systemctl restart smbd.service
Failed to restart smbd.service: Unit not found.

In the past I might had looked in /etc/rc.d/init.d/ for the service, but it doesn't show the smbd service there. I know the service is running by the following:

netstat -plnt | grep smbd
tcp        0      0   *               LISTEN      1753/smbd           
tcp        0      0   *               LISTEN      1753/smbd           
tcp6       0      0 :::139                  :::*                    LISTEN      1753/smbd           
tcp6       0      0 :::445                  :::*                    LISTEN      1753/smbd   

From one of the outputs of the command I saw systemd was being used, so following some instructions from a site I tried the following (and it failed):

systemctl stop smbd.service      
Failed to stop smbd.service: Unit smbd.service not loaded.

So, now I am at a lost and my search fu has yield nothing to help me find where these services are located and how to query their status, stop/start/restart them.

  • You can run the following command to get a list of all loaded, active, services systemd manages: systemctl --state=active --type=service list-units – jdwolf Nov 15 '17 at 3:38
  • This is probably because smbd is masked. What is the status? systemctl status smbd.service – jdwolf Nov 15 '17 at 3:40
  • Thanks, @jdwolf, using your command to list the loaded and active service I did find out the service name is smb.service. Thanks! – lordhog Nov 15 '17 at 21:17

You are using the wrong name.

What the Debian world knows as samba-ad-dc.service is called samba.service in the rest of the world outwith Debian. Similarly, nmbd.service and smbd.service are originally nmb.service and smb.service outwith Debian.

Further reading

  • Using @jdwolf suggestion of querying the services I did find the service name is smb.service and was able to issue the command systemctl restart smb.service which seemed to execute without issue. – lordhog Nov 15 '17 at 21:16

You may try common process check:

# ps auxf | grep -2 smb

And from $PATH:

# whereis smb # or 
# whereis smbd

# systemctl restart sbm may work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.