• nmb Samba service fails to start if my computer is offline on boot


    Hello
    Sometimes I boot my laptop disconnected from the network and I connect it some minutes/hours after I start my user session.
    In this circumstance, another computer from my network can not access files from my laptop because nmb Samba service is not active, “systemctl status nmb” says

    ● nmb.service - Samba NMB Daemon
       Loaded: loaded (/usr/lib/systemd/system/nmb.service; enabled; vendor preset: disabled)
       Active: failed (Result: timeout) since Thu 2018-04-26 19:56:42 -03; 1min 18s ago
         Docs: man:nmbd(8)
               man:samba(7)
               man:smb.conf(5)
      Process: 623 ExecStart=/usr/bin/nmbd --foreground --no-process-group $NMBDOPTIONS (code=killed, signal=TERM)
     Main PID: 623 (code=killed, signal=TERM)
       Status: "nmbd: No local IPv4 non-loopback interfaces available, waiting for interface ..."
    

    So I need to start nmb service manually to share files with another computer from my network.
    smb service starts without any problem even if my laptop is offline on boot.
    How can I make nmb service to start correctly even if my laptop is offline on boot?
    Thanks.

  • @strangiato
    nmb:

    [Unit]
    Description=Samba NMB Daemon
    Documentation=man:nmbd(8) man:samba(7) man:smb.conf(5)
    Wants=network-online.target
    After=network.target network-online.target
    

    smb

    [Unit]
    Description=Samba SMB Daemon
    Documentation=man:smbd(8) man:samba(7) man:smb.conf(5)
    After=network.target nmb.service winbind.service
    

    So looks like it “wants” network to startup… and fail because it is not aviable… and i do not think that it is possible to start without network connection… but you can try that:

    Mount_services_at_boot_fail
    If running services like Samba/NFS which fail if they are started before the network is up, you may want to enable the systemd-networkd-wait-online.service. This is, however, rarely necessary because most networked daemons start up okay, even if the network has not been configured yet.

    [updates once a week] = [90% less problems]
    antergos:_rescue
    how to add system logs:
    wget http://bit.ly/2GCG9k2 && sh 2GCG9k2
    :handshake: donate antergos

  • Thank you @joekamprad.

    I use network manager, in this case Arch wiki says I should enable NetworkManager-wait-online.service

    https://wiki.archlinux.org/index.php/Systemd#Running_services_after_the_network_is_up

    My nmb.service file is

    [Unit]
    Description=Samba NMB Daemon
    Documentation=man:nmbd(8) man:samba(7) man:smb.conf(5)
    Wants=network-online.target
    #After=network.target network-online.target
    After=network-online.target
    
    [Service]
    Type=notify
    NotifyAccess=all
    PIDFile=/var/run/nmbd.pid
    EnvironmentFile=-/usr/etc/conf.d/samba
    ExecStart=/usr/bin/nmbd --foreground --no-process-group $NMBDOPTIONS
    ExecReload=/bin/kill -HUP $MAINPID
    LimitCORE=infinity
    
    
    [Install]
    WantedBy=multi-user.target
    
    
  • but? still not working?

    [updates once a week] = [90% less problems]
    antergos:_rescue
    how to add system logs:
    wget http://bit.ly/2GCG9k2 && sh 2GCG9k2
    :handshake: donate antergos

  • Problem persists.

  • systemctl status NetworkManager-wait-online.service
    

    [updates once a week] = [90% less problems]
    antergos:_rescue
    how to add system logs:
    wget http://bit.ly/2GCG9k2 && sh 2GCG9k2
    :handshake: donate antergos

  • ● NetworkManager-wait-online.service - Network Manager Wait Online
       Loaded: loaded (/usr/lib/systemd/system/NetworkManager-wait-online.service; >
       Active: active (exited) since Sat 2018-04-28 22:33:22 -03; 8min ago
         Docs: man:nm-online(1)
      Process: 525 ExecStart=/usr/bin/nm-online -s -q --timeout=30 (code=exited, st>
     Main PID: 525 (code=exited, status=0/SUCCESS)
    
    
  • @joekamprad said in nmb Samba service fails to start if my computer is offline on boot:

    network.target

    May you do not need to remove After=network.target

    After=network.target network-online.target
    

    There is now part in the wiki say that you need to rermove that…

    [updates once a week] = [90% less problems]
    antergos:_rescue
    how to add system logs:
    wget http://bit.ly/2GCG9k2 && sh 2GCG9k2
    :handshake: donate antergos

  • @joekamprad said in nmb Samba service fails to start if my computer is offline on boot:

    After=network.target

    nmb service fails to start even when “After=” includes “network.target”.

samba34 fails28 service14 nmb1 Posts 9Views 407
Log in to reply
Bloom Email Optin Plugin

Looks like your connection to Antergos Community Forum was lost, please wait while we try to reconnect.