samba排錯 "Failed to start Samba SMB Daemon."

記錄一次服務出錯排錯的過程,這裏簡單舉出個流程出來希望有所幫助。問問題之前善用各大搜索引擎以及博客論壇的搜索功能!

 

# 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-18 16: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 18 16:20:07 localhost.localdomain systemd[1]: Starting Samba SMB Daemon...
May 18 16: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.2 with link time reference
May 18 16: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命令來測試smb.conf配置檔的合法性

[root@longlong Templates]# testparm
Load smb config files from /etc/samba/smb.conf
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
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章