错误
$ sudo service smbd restartJob for smbd.service failed because the control process exited witherror code. See "systemctl status smbd.service" and "journalctl -xe"for details.
$ systemctl status smbd.servicesmbd.service - Samba SMB DaemonLoaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)Active: failed (Result: exit-code) since Fri -10-02 09:41:43 CST; 1min 1s agoDocs: man:smbd(8)man:samba(7)man:smb.conf(5)Process: 9861 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)Process: 28312 ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS (code=exited, status=1/FAILURE)Main PID: 28312 (code=exited, status=1/FAILURE)Oct 02 09:41:43 ubuntu systemd[1]: Starting Samba SMB Daemon...Oct 02 09:41:43 ubuntu systemd[1]: smbd.service: Main process exited, code=exited, status=1/FAILUREOct 02 09:41:43 ubuntu systemd[1]: Failed to start Samba SMB Daemon.Oct 02 09:41:43 ubuntu systemd[1]: smbd.service: Unit entered failed state.Oct 02 09:41:43 ubuntu systemd[1]: smbd.service: Failed with result 'exit-code'.
$ sudo systemctl start smb.serviceFailed to start smb.service: Unit smb.service not found.
一步一步检测错误
$ testparmLoad smb config files from /etc/samba/smb.confrlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)WARNING: Ignoring invalid value 'share' for parameter 'security'Error loading services.
这个时候发现配置文件的问题smb.conf 里面没有设置好
vim /etc/samb/smb.conf
重新修改配置文件
root@ubuntu:~# testparmLoad smb config files from /etc/samba/smb.confrlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)WARNING: The "syslog" option is deprecatedProcessing section "[printers]"Processing section "[print$]"Processing section "[Home share]"Processing section "[LXY]"Loaded services file OK.Server role: ROLE_STANDALONE
这个时候发现好了
然后
sudo systemctl restart smbd.service
就好了