• 记一次samba排错 Failed to start Samba SMB Daemon.


     

     记录一次服务出错排错的过程,很多新手出了点错不百度直接巴拉巴拉的问,一般老手根据经验可以给出一点建议,但是由于个体环境的差异并不适用,反而埋怨起来。这种真的无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-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



  • 相关阅读:
    JS 异步编程
    JS XMLHttpRequest
    JS 日期
    JS DOM
    JS 异常处理
    JS BOM
    JS 正则表达式
    JS 面向对象
    (22)python PhantomJS
    HDU1698 线段树(区间更新区间查询)
  • 原文地址:https://www.cnblogs.com/hehehe886/p/7605348.html
Copyright © 2020-2023  润新知