Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Samba only works after it's restarted

  1. #1
    Join Date
    Aug 2005
    Location
    Norfolk, UK
    Beans
    389
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Samba only works after it's restarted

    I have my 14.10 machine as a samba server, but oddly samba only works after I run "sudo service smbd restart"

    I do remember seeing a thread on this but I can't find it now.

    The problem seems to be that the samba server loads up before the network card is initialised.

    Is there a way to fix this once and for all?

  2. #2
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Samba only works after it's restarted

    Quote Originally Posted by c-m View Post
    I have my 14.10 machine as a samba server, but oddly samba only works after I run "sudo service smbd restart"

    I do remember seeing a thread on this but I can't find it now.

    The problem seems to be that the samba server loads up before the network card is initialised.

    Is there a way to fix this once and for all?
    How do you know that the Samba daemons are not running?

    When you have the Samba server in the non-running condition (initial boot ???), what do you get from this command
    Code:
    pgrep -l mbd
    What is the exact response when you use sudo service smbd restart initially? The response is different when starting the smbd daemon form when re-starting the daemon.
    -BAB1

  3. #3
    Join Date
    Aug 2005
    Location
    Norfolk, UK
    Beans
    389
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: Samba only works after it's restarted

    When I run 'sudo service smbd restart' I get:

    Code:
    smbd stop/waiting
    smbd start/running, process 31866
    After the restart:

    Code:
    pgrep -l mbd
    1159 nmbd
    31866 smbd
    31871 smbd
    Before the restart:

    Code:
    pgrep -l mbd
    1206 smbd
    1209 smbd
    1240 nmbd
    Last edited by c-m; March 24th, 2015 at 05:18 PM. Reason: had to restart to post the output

  4. #4
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Samba only works after it's restarted

    Quote Originally Posted by c-m View Post
    When I run 'sudo service smbd restart' I get:

    Code:
    smbd stop/waiting
    smbd start/running, process 31866
    After the restart:

    Code:
    pgrep -l mbd
    1159 nmbd
    31866 smbd
    31871 smbd
    Before the restart:

    Code:
    pgrep -l mbd
    1206 smbd
    1209 smbd
    1240 nmbd
    It appears that the Samba server is running when the machine is initially started. Note that in all of the above tests both smbd and nmbd are running.
    When restarting the service smbd just re-announcing itself to the network.

    Is browsing the network initially your problem?
    -BAB1

  5. #5
    Join Date
    Aug 2005
    Location
    Norfolk, UK
    Beans
    389
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: Samba only works after it's restarted

    Yes. Unless I run 'sudo service smbd restart' after turning the computer on, my other devices cannot connect to the server.

  6. #6
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Samba only works after it's restarted

    Quote Originally Posted by c-m View Post
    Yes. Unless I run 'sudo service smbd restart' after turning the computer on, my other devices cannot connect to the server.
    Did you use the configuration tips I gave you on your earlier Samba server (name resolve order = bcast). I would also use this: netbios name = "some name" (where "some name" is a name that is 15 characters or less. What do you get from this command
    Code:
    hostname
    This type of problem is due to the host naming process (NETBIOS) is not configured correctly. What do you get from this command
    Code:
    cat /etc/hosts
    -BAB1

  7. #7
    Join Date
    Aug 2005
    Location
    Norfolk, UK
    Beans
    389
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: Samba only works after it's restarted

    Hmm

    Code:
    hostname
    Home
    Code:
    cat /etc/hosts
    127.0.0.1	localhost
    127.0.1.1	Home
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    In samba.conf netbios is Samba24

    Code:
    [global]
    	netbios name = Samba24

  8. #8
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Samba only works after it's restarted

    Quote Originally Posted by c-m View Post
    Hmm

    Code:
    hostname
    Home
    Code:
    cat /etc/hosts
    127.0.0.1	localhost
    127.0.1.1	Home
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    In samba.conf netbios is Samba24

    Code:
    [global]
    	netbios name = Samba24
    I assume you mean the file smb.conf NOT samba.conf.

    Right under netbios name = Samba24 you can add the line
    Code:
    name resolve order = bcast
    ...then you can reboot the system.

    See if you can browse for Samba24
    -BAB1

  9. #9
    Join Date
    Aug 2005
    Location
    Norfolk, UK
    Beans
    389
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: Samba only works after it's restarted

    unfortunately there is no change after added that. On a fresh reboot i can't access the server by IP or name.

    I don't see how this doesn't affect everyone running 14.04 and 14.10 as I haven't done anything special to the default samba conf.
    Last edited by c-m; March 24th, 2015 at 06:16 PM.

  10. #10
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Samba only works after it's restarted

    Quote Originally Posted by c-m View Post
    unfortunately there is no change after added that. On a fresh reboot i can't access the server by IP or name.
    It's hard to diagnose "no change after I added that". What errors do you get?

    If you can't connect by IP address from a remote client then you have IP networking problems that you need to cure before Samba will work.

    Can you connect to Samba from the Samba server itself? Samba can be both a Server and a Client at the same time.

    Post the output of this command from the Samba server terminal
    Code:
    smbtree -d3
    -BAB1

Page 1 of 3 123 LastLast

Tags for this Thread

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
  •