Samba 服务启动不起来,帮我看一下什么原因

2017-04-03 20:07:49 +08:00
 wex
强制断电了一次,就不能访问共享了。启动服务提示如下错误
[ ok ] Restarting nmbd (via systemctl): nmbd.service.
[....] Restarting smbd (via systemctl): smbd.serviceJob for smbd.service failed. See 'systemctl status smbd.service' and 'journalctl -xn' for details.
19614 次点击
所在节点    问与答
22 条回复
sagaxu
2017-04-03 20:09:46 +08:00
See 'systemctl status smbd.service' and 'journalctl -xn' for details.
wex
2017-04-03 21:34:58 +08:00
@sagaxu 不太懂,解释一下
him007
2017-04-03 21:44:23 +08:00
@wex 分别运行引号内的命令,贴上输出内容
wex
2017-04-03 22:07:20 +08:00
@him007
smbd.service - LSB: start Samba SMB/CIFS daemon (smbd)
Loaded: loaded (/etc/init.d/smbd)
Active: failed (Result: exit-code) since Mon 2017-04-03 14:06:30 UTC; 9s ago
Process: 3320 ExecStart=/etc/init.d/smbd start (code=exited, status=1/FAILURE)
him007
2017-04-03 22:46:12 +08:00
@wex 另一个命令呢?你是 centos7 , samba 是编译的?
wex
2017-04-03 22:46:43 +08:00
@him007 另一个 No journal files were found.

树莓派的 debian
MFC
2017-04-03 22:53:19 +08:00
我感觉自从用上 systemd 后,出错信息要么不得要领,要么含混晦涩,远不如以前那么直达要害。

建议直接运行 smbd 的 debug 模式,看看到底是哪儿的问题。
him007
2017-04-03 22:54:05 +08:00
@wex 找找其它地方有没有 smbd 的日志,没有的话就改配置文件设置一下
MFC
2017-04-03 22:54:58 +08:00
@wex 现在树莓派这种瘦设备也上 systemd 了?幸好 openwrt 还没请进这个瘟神。。。
him007
2017-04-03 23:00:05 +08:00
对了,运行 /etc/init.d/smbd start 出现什么内容呢?
sagaxu
2017-04-03 23:11:11 +08:00
@MFC 以前有的 log 现在 systemd 都有,还更详细了,如何晦涩?
wex
2017-04-03 23:27:15 +08:00
@him007
[....] Starting smbd (via systemctl): smbd.serviceJob for smbd.service failed. See 'systemctl status smbd.service' and 'journalctl -xn' for details.
failed!
billlee
2017-04-03 23:49:49 +08:00
r#4 @wex 这个是 systemd 兼容旧的 sys v init script 启动的,日志应该还是在 /var/log 下,你找找有没有
Osk
2017-04-03 23:59:13 +08:00
看看 journalctl -b | grep smbd 会不会有更多消息,
试试 testparm 看下配置文件是否正确, 需要的共享文件夹是否存在

还不行可能要调整 samba 的日志级别看看了
him007
2017-04-03 23:59:31 +08:00
运行`smbd -F -S` ,,会输出日志,下面是我在 archlinux 上运行的

shell>smbd -F -S 23:48:51
smbd version 4.5.8 started. Copyright Andrew Tridgell and the Samba Team 1992-2016 Registered MSG_REQ_POOL_USAGE Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED Processing section "[home]" Processing section "[FILE]" Processing section "[SSD]" Processing section "[music]" added interface wlan0 ip=192.168.111.10 bcast=192.168.111.255 netmask=255.255.255.0 INFO: Profiling support unavailable in this build. ERROR: smbd is already running. File /var/run/smbd.pid exists and process id 742 is running.
wex
2017-04-04 00:04:12 +08:00
@billlee 不知道是不是这个
[2017/04/03 08:34:33.385682, 0] ../source3/nmbd/nmbd.c:58(terminate)
Got SIGTERM: going down...
[2017/04/03 08:35:21, 0] ../source3/nmbd/nmbd.c:908(main)
[2017/04/03 08:35:21.670403, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'nmbd' finished starting up and ready to serve connections
[2017/04/03 08:54:30.536025, 0] ../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
*****


*****
[2017/04/03 08:35:11, 0] ../source3/nmbd/nmbd.c:908(main)
nmbd version 4.2.14-Debian started.
Copyright Andrew Tridgell and the Samba Team 1992-2014
[2017/04/03 08:35:11.610192, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'nmbd' finished starting up and ready to serve connections
[2017/04/03 10:28:31.900755, 0] ../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
*****

[2017/04/03 11:48:58.889021, 0] ../source3/nmbd/nmbd.c:58(terminate)
Got SIGTERM: going down...
[2017/04/03 11:49:01, 0] ../source3/nmbd/nmbd.c:908(main)
nmbd version 4.2.14-Debian started.
Copyright Andrew Tridgell and the Samba Team 1992-2014
[2017/04/03 11:49:01.479190, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'nmbd' finished starting up and ready to serve connections
[2017/04/03 11:49:17.088986, 0] ../source3/nmbd/nmbd.c:58(terminate)
Got SIGTERM: going down...
[2017/04/03 11:49:23, 0] ../source3/nmbd/nmbd.c:908(main)
nmbd version 4.2.14-Debian started.
Copyright Andrew Tridgell and the Samba Team 1992-2014
[2017/04/03 11:49:46.269279, 0] ../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
*****


*****
[2017/04/03 11:51:39.389475, 0] ../source3/nmbd/nmbd.c:58(terminate)
Got SIGTERM: going down...
[2017/04/03 11:51:41, 0] ../source3/nmbd/nmbd.c:908(main)
nmbd version 4.2.14-Debian started.
Copyright Andrew Tridgell and the Samba Team 1992-2014
[2017/04/03 11:52:05.009546, 0] ../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
*****

Samba name server RASPBERRYPI is now a local master browser for workgroup WORKGROUP on subnet 192.168.1.111

*****
[2017/04/03 11:59:40.236669, 0] ../source3/nmbd/nmbd.c:58(terminate)
Got SIGTERM: going down...
[2017/04/03 12:05:37, 0] ../source3/nmbd/nmbd.c:908(main)
nmbd version 4.2.14-Debian started.
Copyright Andrew Tridgell and the Samba Team 1992-2014
[2017/04/03 12:05:37.234519, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'nmbd' finished starting up and ready to serve connections
[2017/04/03 12:06:00.269409, 0] ../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
*****

Samba name server RASPBERRYPI is now a local master browser for workgroup WORKGROUP on subnet 192.168.1.111
wex
2017-04-04 00:05:19 +08:00
@him007 输出如下
Failed to create /var/log/samba/cores for user 1000 with mode 0700
Unable to setup corepath for smbd: Operation not permitted
smbd version 4.2.14-Debian started.
billlee
2017-04-04 00:10:05 +08:00
r#16 @wex 这个是哪个文件?貌似是 nmbd 的日志,但你这边启动失败的是 smbd 吧
him007
2017-04-04 00:16:11 +08:00
@wex @him007 /var/log/samba/cores 看了一下是文件夹,你那有没有存在这文件夹?运行 ls -ld /var/log/samba/cores 看看,不存在就看看上级目录的属性
him007
2017-04-04 00:21:24 +08:00
@wex 不对,`smbd -FS`要 root 权限运行,你用的是普通用户。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/352339

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX