我需要在 Ubuntu 12.04 服务器上禁用(而不是卸载)Samba,但我在 rc2.d 目录中看不到任何链接。重启后 Samba 是如何启动的?如何禁用 smbd/nmbd 守护进程?什么是 winbind?
root@newnagios:~# ll /etc/rc2.d/
total 12
drwxr-xr-x 2 root root 4096 Aug 15 16:23 ./
drwxr-xr-x 101 root root 4096 Aug 16 12:13 ../
-rw-r--r-- 1 root root 677 Jul 26 2012 README
lrwxrwxrwx 1 root root 17 Aug 4 20:34 S20postfix -> ../init.d/postfix*
lrwxrwxrwx 1 root root 15 Aug 12 15:55 S20snmpd -> ../init.d/snmpd*
lrwxrwxrwx 1 root root 17 Aug 4 20:34 S20winbind -> ../init.d/winbind*
lrwxrwxrwx 1 root root 13 Aug 5 12:42 S23ntp -> ../init.d/ntp*
lrwxrwxrwx 1 root root 15 Aug 4 18:07 S25mdadm -> ../init.d/mdadm*
lrwxrwxrwx 1 root root 15 Aug 4 20:34 S50rsync -> ../init.d/rsync*
lrwxrwxrwx 1 root root 19 Aug 4 20:34 S70dns-clean -> ../init.d/dns-clean*
lrwxrwxrwx 1 root root 18 Aug 4 20:34 S70pppd-dns -> ../init.d/pppd-dns*
lrwxrwxrwx 1 root root 14 Aug 4 22:03 S75sudo -> ../init.d/sudo*
lrwxrwxrwx 1 root root 17 Aug 4 20:34 S91apache2 -> ../init.d/apache2*
lrwxrwxrwx 1 root root 21 Aug 4 20:35 S99grub-common -> ../init.d/grub-common*
lrwxrwxrwx 1 root root 18 Aug 4 18:06 S99ondemand -> ../init.d/ondemand*
lrwxrwxrwx 1 root root 18 Aug 4 18:06 S99rc.local -> ../init.d/rc.local*
答案1
输入以下命令停止 smbd 服务。
停止 Samba:
sudo service smbd stop
或者
sudo /etc/init.d/smbd stop
启动 Samba:
sudo service smbd start
或者
sudo /etc/init.d/smbd start
要从 rc.d 文件中删除它,请使用以下命令
sudo update-rc.d -f smbd remove
要将其恢复到 rc.d,请使用以下命令
sudo update-rc.d smbd defaults
答案2
使用此命令禁用 Samba 服务:
update-rc.d -f smbd defaults
或者将其用于 Upstart 服务:
echo 'manual' | sudo tee /etc/init/smbd.conf
或者您可以安装并检查服务:
apt-get install rcconf