Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Samba has to be restarted on client reboot

  1. #1
    Join Date
    Jul 2013
    Beans
    8

    Samba has to be restarted on client reboot

    Hiya,

    Using Ubuntu 12.10 (client) and 12.04 (server) and I have a somewhat annoying problem. Every time I reboot my client computer I have to SSH back to my server and restart samba so that the client can mount the shared folders again. Soon as I do a 'sudo smbd restart' and then a 'sudo mount -a' on the client, I'm back in business and I can see the mounted shares as normal.

    smb.conf:

    Code:
    [global]    ; General server settings
        netbios name = BIGMOMMA
        server string =
        workgroup = WORKGROUP
        announce version = 5.0
        socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
    
    
        passdb backend = tdbsam
        security = user
        null passwords = true
        username map = /etc/samba/smbusers
        name resolve order = hosts wins bcast
    
    
        wins support = no
    
    
        printing = CUPS
        printcap name = CUPS
    
    
        syslog = 1
        syslog only = yes
    
    
    ; NOTE: If you need access to the user home directories uncomment the
    ; lines below and adjust the settings to your hearts content.
    ;[homes]
        ;valid users = %S
        ;create mode = 0600
        ;directory mode = 0755
        ;browseable = no
        ;read only = no
        ;veto files = /*.{*}/.*/mail/bin/
    
    
    ; NOTE: Only needed if you run samba as a primary domain controller.
    ; Not needed as this config doesn't cover that matter.
    ;[netlogon]
        ;path = /var/lib/samba/netlogon
        ;admin users = Administrator
        ;valid users = %U
        ;read only = no
    
    
    ; NOTE: Again - only needed if you're running a primary domain controller.
    ;[Profiles]
        ;path = /var/lib/samba /profiles
        ;valid users = %U
        ;create mode = 0600
        ;directory mode = 0700
        ;writeable = yes
        ;browseable = no
    
    
    ; NOTE: Inside this place you may build a printer driver repository for
    ; Windows - I'll cover this topic in another HOWTO.
    [print$]
        path = /var/lib/samba/printers
        browseable = yes
        guest ok = yes
        read only = yes
        write list = root
        create mask = 0664
        directory mask = 0775
    
    
    [printers]
        path = /tmp
        printable = yes
        guest ok = yes
        browseable = no
    
    
    ; Uncomment if you need to share your CD-/DVD-ROM Drive
    ;[DVD-ROM Drive]
        ;path = /media/cdrom
        ;browseable = yes
        ;read only = yes
        ;guest ok = yes
    
    
    [BigShare]
        path = /home/matt/Sharing
        browseable = yes
        read only = no
        guest ok = no
        create mask = 0644
        directory mask = 0755
        force user = matt
        force group = matt
    I have tried using the samba GUI application, but the same thing happens and so I'm using an older smb.conf that used to work well (in 10.04)..obviously it doesn't. If I try to mount the samba share without restarting samba before hand I get:

    Code:
    mount error(6): No such device or address
    Any help is appreciated.

  2. #2
    Join Date
    Dec 2009
    Beans
    5,375

    Re: Samba has to be restarted on client reboot

    That's a rather odd symptom. Well, the symptom isn't odd it's the fix that's odd. One would think that restarting nmbd not smbd would fix it because of the rather primitive netbios mechanism that samba defaults to because it's set for a Windows network not a Linux/OSX network.

    *** The "sudo mount -a" comment suggests that you have a entry in fstab to mount this share. Can you show us that line so we can see how it's set up.

    *** Are you connecting to the server by ip address or by name? If it's by name see if after the next reboot you can access the server by it's mDNS qualified name instead:
    Code:
    nautilus smb://hostname.local
    Where hostname is the host name of the server - and don't forget the ".local" part.

    There could be another explanation: It's not the restarting of smbd on the server it's the "sudo mount -a" on the client that's fixing things. It could be that fstab is executed before the network is up on the client.
    Last edited by Morbius1; November 20th, 2013 at 01:43 PM.

  3. #3
    Join Date
    Jul 2013
    Beans
    8

    Re: Samba has to be restarted on client reboot

    Thanks for the reply

    I'm connecting by name, not IP - here's the relevant line in fstab:

    Code:
    //BIGMOMMA/BigShare    /media/bigmomma        cifs    credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
    if I try the mDNS qualified name, it comes up with a file manager window, with a directory to bigshare, but when I try to click into the shared directory, it tells me that it doesn't exist.

    I've tried just mounting without restarting samba on the server and I just get the same error:

    Code:
    mount error(6): No such device or address
    I was previously restarting both smbd and nmbd, but then, after fiddling, found that just restarting smbd on its own works.

    Thanks for trying! =)

    edit:

    Just tried, restarting nmbd on its own (then remounting the client) doesn't work
    Last edited by rathershocked; November 20th, 2013 at 02:56 PM.

  4. #4
    Join Date
    Dec 2009
    Beans
    5,375

    Re: Samba has to be restarted on client reboot

    If you haven’t restarted smbd on the server yet does everything work if you pass the credentialed username to the server + mDNS:
    Code:
    nautilus smb://username@bigmomma.local

  5. #5
    Join Date
    Jul 2013
    Beans
    8

    Re: Samba has to be restarted on client reboot

    I get the same result, unfortunately - file manager will come up, try to log into the shared directory, password is requested but then says it doesn't exist.

    Sorry for the silly questions, but do you think this may possibly be related to router issues - I know when I upgraded the server, my brother also was fiddling around with various bits and bobs in my router (old Linksys with Tomato) - haven't quizzed him about what he actually did as yet.

  6. #6
    Join Date
    Dec 2009
    Beans
    5,375

    Re: Samba has to be restarted on client reboot

    It seems to me that if it was a router problem it would exist even after you restarted smbd on the server.

    I wanted to pursue the mDNS route because I was convinced that this was a name resolution issue. The default netbios mechanism is one way and the mDNS way is another faster way but in this case both fail.

    It really does seem like smbd shuts itself off on the server and I can't imagine why it would do that on it's own and certainly not triggered by a samba client going away and coming back. There will always be a delay in the netbios name discovery mechanism when a new client enters the network - it could take several minutes. But hostname.local is immediate and doesn't have this delay issue.

    I'm really at a loss here trying to imagine a process that would result in this. Is this happening on all the clients to this server of just this one?

  7. #7
    Join Date
    Jul 2013
    Beans
    8

    Re: Samba has to be restarted on client reboot

    Hiya

    I actually just reset tomato to defaults anyway..and as you suggest, no difference.

    I was going to state that it happens on other client devices (I rarely use the share on other clients), but just checked and my netbook (Lubuntu 12.10) works absolutely fine - I don't have it perma-mounted in fstab, but going through network drives in nautilus, it displays the share with no issues.

    Clearly this must be an issue with my main PC. Thanks for trying to help..it's at least given me a pointer as to where the problem may lie =)

  8. #8
    Join Date
    Dec 2009
    Beans
    5,375

    Re: Samba has to be restarted on client reboot

    I'm shutting down for the day but you might want to post the output of this command so folks here can see how your smb.conf is set up on the client that's having the problem:
    Code:
    testparm -s
    Most of smb.conf deals with server configurations but there are items in there that affect the samba client even if you didn't install the samba server.

  9. #9
    Join Date
    Jul 2013
    Beans
    8

    Re: Samba has to be restarted on client reboot

    Thanks again!

    Code:
    Load smb config files from /etc/samba/smb.confrlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
    Processing section "[printers]"
    Processing section "[print$]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    [global]
            server string = %h server (Samba, Ubuntu)
            map to guest = Bad User
            obey pam restrictions = Yes
            pam password change = Yes
            passwd program = /usr/bin/passwd %u
            passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
            unix password sync = Yes
            syslog = 0
            log file = /var/log/samba/log.%m
            max log size = 1000
            dns proxy = No
            usershare allow guests = Yes
            panic action = /usr/share/samba/panic-action %d
            idmap config * : backend = tdb
    
    
    [printers]
            comment = All Printers
            path = /var/spool/samba
            create mask = 0700
            printable = Yes
            print ok = Yes
            browseable = No
    
    
    [print$]
            comment = Printer Drivers
            path = /var/lib/samba/printers

  10. #10
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Samba has to be restarted on client reboot

    Quote Originally Posted by rathershocked View Post
    Thanks again!

    Code:
    Load smb config files from /etc/samba/smb.confrlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
    Processing section "[printers]"
    Processing section "[print$]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    [global]
            server string = %h server (Samba, Ubuntu)
            map to guest = Bad User
            obey pam restrictions = Yes
            pam password change = Yes
            passwd program = /usr/bin/passwd %u
            passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
            unix password sync = Yes
            syslog = 0
            log file = /var/log/samba/log.%m
            max log size = 1000
            dns proxy = No
            usershare allow guests = Yes
            panic action = /usr/share/samba/panic-action %d
            idmap config * : backend = tdb
    
    
    [printers]
            comment = All Printers
            path = /var/spool/samba
            create mask = 0700
            printable = Yes
            print ok = Yes
            browseable = No
    
    
    [print$]
            comment = Printer Drivers
            path = /var/lib/samba/printers
    No shares listed. I guess you used the GUI to create the shares.

    Either way let's see what shows with this command
    Code:
    smbclient -L <SERVER_NAME>
    ...where <SERVER_NAME> is the name of your Samba server. You can use the IP address if you like.

    Edit: I don't think the client is the problem. In fact it looks like the client's smb.conf is original and unmolested.
    Last edited by bab1; November 21st, 2013 at 08:12 AM.
    -BAB1

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •