记⼀次samba排错FailedtostartSambaSMBDaemon.
记录⼀次服务出错排错的过程,很多新⼿出了点错不百度直接巴拉巴拉的问,⼀般⽼⼿根据经验可以给出⼀点建议,但是由于个体环境的差异并不适⽤,反
⽽埋怨起来。这种真的⽆F**K可说,所以要培养⾃⼰的排错能⼒是很重要的,这⾥简单的抛砖引⽟的举出个流程出来希望有所帮助。问问题之前善⽤各⼤搜
索引擎以及博客论坛的搜索功能!
# systemctl status smb.service -l
â— smb.service - Samba SMB Daemon
Loaded: loaded (/usr/lib/systemd/system/smb.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2016-05-1816:20:07 CST; 1min 8s ago
Process: 3572 ExecStart=/usr/sbin/smbd $SMBDOPTIONS (code=exited, status=127)
Main PID: 3572 (code=exited, status=127)
May 1816:20:07 localhost.localdomain systemd[1]: Starting Samba
May 1816:20:07 localhost.localdomain smbd[3572]: /usr/sbin/smbd: relocation error: /lib64/libsamba-credentials.so.0: symbol GSS_KRB5_CRED_NO_CI_FLAGS_X, version gssapi_krb5_2_MIT not defined in file libgssapi_krb5.so. May 1816:20:07 localhost.localdomain systemd[1]: smb.service: Main process exited, code=exited, status=127/n/a
May 18 16:20:07 localhost.localdomain systemd[1]: Failed to start Samba SMB Daemon.
May 18 16:20:07 localhost.localdomain systemd[1]: smb.service: Unit entered failed state.
May 18 16:20:07 localhost.localdomain systemd[1]: smb.service: Failed with result 'exit-code'.
//从⽹络上的类似出错,源错误⽇志忘记保存
#systemctl start smb 出错
第⼀步:samba可以⽤testparm命令来测试f配置档的合法性
[root@longlong Templates]# testparm
exited
Load smb config files from /etc/f
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
# Global parameters
[global]
workgroup = SAMBA
printcap name = cups
security = USER
idmap config * : backend = tdb
cups options = raw
[homes]
comment = Home Directories
browseable = No
inherit acls = Yes
read only = No
valid users = %S %D%w%S
[printers]
comment = All Printers
path = /var/tmp
browseable = No
printable = Yes
create mask = 0600
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
create mask = 0664
directory mask = 0775
write list = root
可以看到配置⽂件没有错误,排除此错误!~
第⼆步:使⽤⾃带命令输出samba⽇志
[root@longlong Templates]# smbd -F -S
smbd: relocation error: /usr/lib64/samba/libgse-samba4.so: symbol krb5_get_init_creds_opt_set_pac_request, version krb5_3_MIT not defined in file libkrb5.so.3 with link time reference 出错误原因lib库出错
解决 yum -y install krb5-devel.x86_64 krb5-libs.x86_64
错误原因:进⼀步分析,查看yum源发现是公⽹阿⾥云源,安装了新版本,系统库⽂件⽀持还是⽼版本所以运⾏出错
security=share在新版中已经被废弃了所以最后贴个4以上samba新版本
samba-4.6.2-8.el7.x86_64
建⽴匿名⽤户Linux和windows共享⽬录的配置⽂件:
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
map to guest = Bad User

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。