我正在尝试启动 nmb 服务。它在日志文件中留下了以下内容并存在:
[2013/05/08 14:06:23, 0] ../source3/nmbd/nmbd.c:883(main)
nmbd version 4.0.0rc4 started.
Copyright Andrew Tridgell and the Samba Team 1992-2012
[2013/05/08 14:06:23, 0] ../source3/nmbd/nmbd.c:922(main)
standard input is not a socket, assuming -D option
[2013/05/08 14:06:23, 0] ../source3/lib/util_sock.c:1253(create_pipe_sock)
error creating socket directory /var/run/samba/nmbd: Permission denied
[2013/05/08 14:06:23, 0] ../source3/nmbd/nmbd_packets.c:48(nmbd_init_packet_server)
ERROR: nb_packet_server_create failed: NT_STATUS_ACCESS_DENIED
这是文件夹:
# ls -ldZ /var/run/samba/
drwxr-xr-x. root root system_u:object_r:smbd_var_run_t:s0 /var/run/samba/
这很奇怪:
# service nmb status
nmbd dead but pid file exists
# ls /var/run/samba/nmbd.pid
ls: cannot access /var/run/samba/nmbd.pid: No such file or directory
有任何想法吗?
答案1
这是 selinux 错误,请为 nmbd 禁用 selinux:
chcon -t unconfined_exec_t /usr/sbin/nmbd
或添加套接字规则
semanage fcontext -a -t nmbd_var_run_t /var/run/samba/nmbd/unexpected