V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
wex
V2EX  ›  问与答

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

  •  
  •   wex · 2017-04-03 20:07:49 +08:00 · 19493 次点击
    这是一个创建于 2569 天前的主题,其中的信息可能已经有所发展或是发生改变。
    强制断电了一次,就不能访问共享了。启动服务提示如下错误
    [ 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.
    22 条回复    2017-05-18 17:03:18 +08:00
    sagaxu
        1
    sagaxu  
       2017-04-03 20:09:46 +08:00
    See 'systemctl status smbd.service' and 'journalctl -xn' for details.
    wex
        2
    wex  
    OP
       2017-04-03 21:34:58 +08:00
    @sagaxu 不太懂,解释一下
    him007
        3
    him007  
       2017-04-03 21:44:23 +08:00 via Android
    @wex 分别运行引号内的命令,贴上输出内容
    wex
        4
    wex  
    OP
       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
        5
    him007  
       2017-04-03 22:46:12 +08:00 via Android
    @wex 另一个命令呢?你是 centos7 , samba 是编译的?
    wex
        6
    wex  
    OP
       2017-04-03 22:46:43 +08:00
    @him007 另一个 No journal files were found.

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

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

    还不行可能要调整 samba 的日志级别看看了
    him007
        15
    him007  
       2017-04-03 23:59:31 +08:00 via Android
    运行`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
        16
    wex  
    OP
       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
        17
    wex  
    OP
       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
        18
    billlee  
       2017-04-04 00:10:05 +08:00
    r#16 @wex 这个是哪个文件?貌似是 nmbd 的日志,但你这边启动失败的是 smbd 吧
    him007
        19
    him007  
       2017-04-04 00:16:11 +08:00 via Android
    @wex @him007 /var/log/samba/cores 看了一下是文件夹,你那有没有存在这文件夹?运行 ls -ld /var/log/samba/cores 看看,不存在就看看上级目录的属性
    him007
        20
    him007  
       2017-04-04 00:21:24 +08:00 via Android
    @wex 不对,`smbd -FS`要 root 权限运行,你用的是普通用户。
    wex
        21
    wex  
    OP
       2017-04-04 10:08:16 +08:00
    @him007
    smbd version 4.2.14-Debian started.
    Copyright Andrew Tridgell and the Samba Team 1992-2014
    WARNING: No path in service #homes - making it unavailable!
    set_variable_helper(yes#任何人都具有了访问修改的权限): value is not boolean!
    winsert
        22
    winsert  
       2017-05-18 17:03:18 +08:00
    是配置文件有问题
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5219 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 09:41 · PVG 17:41 · LAX 02:41 · JFK 05:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.