启动服务时提示:
Job for smbd.service failed because the control process exited with error code.
See "systemctl status smbd.service" and "journalctl -xeu smbd.service" for details.
systemctl status smbd
查看状态其实看不出来:
× smbd.service - Samba SMB Daemon
Loaded: loaded (/lib/systemd/system/smbd.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Thu 2024-04-18 18:15:51 CST; 2min 40s ago
Duration: 7min 40.773s
Docs: man:smbd(8)
man:samba(7)
man:smb.conf(5)
Process: 283774 ExecCondition=/usr/share/samba/is-configured smb (code=exited, status=0/SUCCESS)
Process: 283776 ExecStartPre=/usr/share/samba/update-apparmor-samba-profile (code=exited, status=0/SU>
Process: 283777 ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS (code=exited, s>
Main PID: 283777 (code=exited, status=1/FAILURE)
CPU: 267ms
4月 18 18:15:51 pi systemd[1]: Starting smbd.service - Samba SMB Daemon...
4月 18 18:15:51 pi systemd[1]: smbd.service: Main process exited, code=exited, status=1/FAILURE
4月 18 18:15:51 pi systemd[1]: smbd.service: Failed with result 'exit-code'.
4月 18 18:15:51 pi systemd[1]: Failed to start smbd.service - Samba SMB Daemon.
tail -f /var/log/samba/log.smbd
查看日志:
[2024/04/18 18:13:03.887169, 0] ../../source3/smbd/server.c:1741(main)
smbd version 4.17.12-Debian started.
Copyright Andrew Tridgell and the Samba Team 1992-2022
[2024/04/18 18:13:03.888737, 0] ../../lib/param/loadparm.c:1551(set_variable_helper)
set_variable_helper(yes #允许浏览): value is not boolean!
[2024/04/18 18:15:51.669350, 0] ../../source3/smbd/server.c:1741(main)
smbd version 4.17.12-Debian started.
Copyright Andrew Tridgell and the Samba Team 1992-2022
[2024/04/18 18:15:51.670974, 0] ../../lib/param/loadparm.c:1551(set_variable_helper)
set_variable_helper(yes #允许浏览): value is not boolean!
value is not boolean
表示配置文件的值有错误,不是布尔值,检查yes no的后面是否有空格,有的话全部删掉。也包括其他配置,值后面不要有空格,然后重启就成功了。