错误

$ sudo service smbd restart

Job for smbd.service failed because the control process exited with
error code. See "systemctl status smbd.service" and "journalctl -xe"
for details.
$ systemctl status smbd.service

 smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-10-02 09:41:43 CST; 1min 1s ago
     Docs: 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/FAILURE
Oct 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.service
Failed to start smb.service: Unit smb.service not found.

一步一步检测错误

$ testparm

Load smb config files from /etc/samba/smb.conf
rlimit_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:~# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Processing 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

就好了

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐