10

This question has been asked before, but I've tried all the suggested approaches, short of uninstalling.

sudo service smbd stop

sudo echo 'manual' | sudo tee /etc/init/smbd.conf

sudo update-rc.d -f smbd remove

all work until the next reboot. I've even removed the init conf file, and it still starts. How do I disable them until I wish to use them?

Huaidan
  • 351
  • 1
  • 4
  • 11

1 Answers1

16

This is Ubuntu 17.04 and it uses systemd to control and maintain its service so try these commands:

sudo systemctl stop smbd
sudo systemctl disable smbd

And I believe that should stop it first then prevent it from restarting at reboot. To permanently disable it and prevent it from being started even when needed by another service or task use:

sudo systemctl mask smbd

See the link provided by jfs for more information on this

George Udosen
  • 36,677
  • 4
    You might need sudo systemctl mask smbd at the end (same for nmbd). Note: disable means that the service won't be started by itself on startup. It still can start if something else depends on it: "However, a disabled service can be loaded, and will be started if a service that depends on it is started; enable and disable only configure auto-start behaviour for units, and the state is easily overridden." See What is the difference between "systemctl mask" and "systemctl disable"? – jfs Jul 31 '18 at 05:37