无法重启 samba,samba.service 被屏蔽

Mel*_*ton 116 samba

当我尝试重新启动 Samba 时,我收到以下错误消息:

Failed to start samba.service: Unit samba.service is masked.
Run Code Online (Sandbox Code Playgroud)

另外,当我运行时systemctl,它smbd.service以红色显示失败。

同时重启开始失败,我在创建的文件夹中失去了共享能力,无法访问。任何帮助,将不胜感激!!!

GDo*_*orn 167

Debian 和 debian-derivatives 将服务名称从“samba”更改为“smbd”。

试试service smbd restart

  • @BenCreasy 可能是因为协议的名称是 [`smb`](https://en.wikipedia.org/wiki/Server_Message_Block),而且由于这是一个守护进程,所以你会得到 `smbd`。[Samba](https://en.wikipedia.org/wiki/Samba_(software)) 是 `smb` 协议的实现之一的名称。 (4认同)

小智 46

尝试:

sudo systemctl unmask samba
sudo systemctl enable samba
sudo systemctl restart samba
Run Code Online (Sandbox Code Playgroud)

  • http://unix.stackexchange.com/questions/303293/ubuntu-service-samba-is-masked-and-cant-start (8认同)
  • 从 14 升级后,这对我在 Ubuntu 16 上的 mongodb 上遇到了类似的问题。不过,我将第一行更改为 systemctl unmask mongodb.service。这样做后,服务 mongodb status/start/stop 工作。 (4认同)

fan*_*ing 5

这对我有用(Ubuntu 服务器 16):

sudo rm /lib/systemd/system/samba.service 
sudo systemctl enable samba.service nmbd.service
sudo systemctl start samba
Run Code Online (Sandbox Code Playgroud)

这里找到它