[Pkg-samba-maint] Bug#855918: samba: connection refused after reboot, fixable by systemctl restart smbd

Vladislav Kurz vladislav.kurz at webstep.net
Fri Jan 19 09:48:59 UTC 2018


Package: samba
Version: 2:4.5.12+dfsg-2+deb9u1
Followup-For: Bug #855918

Dear Maintainer,

I have encountered the buggy behavior described here, while debugging bug #887556

To mee it seems that the option After=nmbd.service is
ignored somehow, and thus smbd is started before the nework
is online. I have checked it by repeated reboots. I have
removed all my custom units including ZFS, that could affect
the boot ordering. I also tried to split the After option to
several lines with one dependecy per line. Nothing hleped,
smbd starts consistently before network-online (dhclient).

I have checked the smbd, nmbd.service units, checked
journalctl -b, plotted grpahs using sytemd-analyze, but I
could not find anything wrong - no ordering cycle,
everything seems to be as it should.

Perhaps this should be consulted with systemd maintainers,
as the problem might be there. I admit I'm a bit biased
against systemd, as I have spent few days debugging the boot
ordering, which in sysvinit would be a trivial task.

Samba is in default config after install. This is the
relevant part of syslog:

Jan 19 10:06:06 gw kernel: [   40.791981] tg3 0000:02:00.0 eno1: Link is up at 1000 Mbps, full duplex
Jan 19 10:06:06 gw kernel: [   40.791992] tg3 0000:02:00.0 eno1: Flow control is off for TX and off for RX
Jan 19 10:06:06 gw kernel: [   40.791996] tg3 0000:02:00.0 eno1: EEE is disabled
Jan 19 10:06:06 gw kernel: [   40.792031] IPv6: ADDRCONF(NETDEV_CHANGE): eno1: link becomes ready
Jan 19 10:06:08 gw dhclient[874]: DHCPDISCOVER on eno1 to 255.255.255.255 port 67 interval 10
Jan 19 10:06:08 gw ifup[840]: DHCPDISCOVER on eno1 to 255.255.255.255 port 67 interval 10
Jan 19 10:06:09 gw dhclient[874]: DHCPREQUEST of 192.168.220.136 on eno1 to 255.255.255.255 port 67
Jan 19 10:06:09 gw ifup[840]: DHCPREQUEST of 192.168.220.136 on eno1 to 255.255.255.255 port 67
Jan 19 10:06:09 gw ifup[840]: DHCPOFFER of 192.168.220.136 from 192.168.220.1
Jan 19 10:06:09 gw dhclient[874]: DHCPOFFER of 192.168.220.136 from 192.168.220.1
Jan 19 10:06:09 gw dhclient[874]: DHCPACK of 192.168.220.136 from 192.168.220.1
Jan 19 10:06:09 gw ifup[840]: DHCPACK of 192.168.220.136 from 192.168.220.1
Jan 19 10:06:09 gw systemd[1]: Starting Samba SMB Daemon...
Jan 19 10:06:10 gw systemd[1]: smbd.service: Supervising process 944 which is not our child. We'll most likely not notice when it exits.
Jan 19 10:06:10 gw systemd[1]: Started Samba SMB Daemon.
Jan 19 10:06:10 gw dhclient[874]: bound to 192.168.220.136 -- renewal in 35078 seconds.
Jan 19 10:06:10 gw ifup[840]: bound to 192.168.220.136 -- renewal in 35078 seconds.
Jan 19 10:06:10 gw kernel: [   45.080527] IPv6: ADDRCONF(NETDEV_UP): eno2: link is not ready
Jan 19 10:06:10 gw systemd[1]: Started Raise network interfaces.
Jan 19 10:06:10 gw systemd[1]: Reached target Network.
Jan 19 10:06:10 gw systemd[1]: Reached target Network is Online.
Jan 19 10:06:10 gw systemd[1]: Starting LSB: exim Mail Transport Agent...
Jan 19 10:06:10 gw systemd[1]: Starting LSB: DHCP server...
Jan 19 10:06:10 gw systemd[1]: Starting LSB: Start NTP daemon...
Jan 19 10:06:10 gw systemd[1]: Starting Samba NMB Daemon...
Jan 19 10:06:10 gw systemd[1]: Starting LSB: disk temperature monitoring daemon...
Jan 19 10:06:10 gw systemd[1]: Starting Permit User Sessions...
Jan 19 10:06:10 gw systemd[1]: Starting OpenBSD Secure Shell server...
Jan 19 10:06:10 gw systemd[1]: Started Permit User Sessions.
Jan 19 10:06:10 gw systemd[1]: Created slice User Slice of root.
Jan 19 10:06:10 gw systemd[1]: Starting User Manager for UID 0...
Jan 19 10:06:10 gw systemd[1]: Started Getty on tty1.
Jan 19 10:06:10 gw systemd[1]: Reached target Login Prompts.
Jan 19 10:06:10 gw systemd[1]: nmbd.service: Supervising process 1040 which is not our child. We'll most likely not notice when it exits.
Jan 19 10:06:10 gw systemd[1]: Started Samba NMB Daemon.

Just for record:

~# cat /lib/systemd/system/smbd.service                                                                                                                                                
[Unit]                                                                                                                                                                                                  
Description=Samba SMB Daemon                                                                                                                                                                            
Documentation=man:smbd(8) man:samba(7) man:smb.conf(5)                                                                                                                                                  
After=network.target                                                                                                                                                                                    
After=nmbd.service                                                                                                                                                                                      
After=winbind.service                                                                                                                                                                                   
                                                                                                                                                                                                        
[Service]                                                                                                                                                                                               
Type=notify                                                                                                                                                                                             
NotifyAccess=all                                                                                                                                                                                        
PIDFile=/var/run/samba/smbd.pid                                                                                                                                                                         
LimitNOFILE=16384                                                                                                                                                                                       
EnvironmentFile=-/etc/default/samba                                                                                                                                                                     
ExecStart=/usr/sbin/smbd $SMBDOPTIONS                                                                                                                                                                   
ExecReload=/bin/kill -HUP $MAINPID                                                                                                                                                                      
LimitCORE=infinity                                                                                                                                                                                      
                                                                                                                                                                                                        
[Install]                                                                                                                                                                                               
WantedBy=multi-user.target                                                                                                                                                                              

====

~# cat /lib/systemd/system/nmbd.service 
[Unit]
Description=Samba NMB Daemon
Documentation=man:nmbd(8) man:samba(7) man:smb.conf(5)
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
NotifyAccess=all
PIDFile=/var/run/samba/nmbd.pid
EnvironmentFile=-/etc/default/samba
ExecStart=/usr/sbin/nmbd $NMBDOPTIONS
ExecReload=/bin/kill -HUP $MAINPID
LimitCORE=infinity

[Install]
WantedBy=multi-user.target


====


Best Regards
Vladislav Kurz


-- System Information:
Debian Release: 9.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages samba depends on:
ii  adduser              3.115
ii  dpkg                 1.18.24
ii  init-system-helpers  1.48
ii  libbsd0              0.8.3-1
ii  libc6                2.24-11+deb9u1
ii  libldb1              2:1.1.27-1+b1
ii  libpam-modules       1.1.8-3.6
ii  libpam-runtime       1.1.8-3.6
ii  libpopt0             1.16-10+b2
ii  libpython2.7         2.7.13-2+deb9u2
ii  libtalloc2           2.1.8-1
ii  libtdb1              1.3.11-2
ii  libtevent0           0.9.31-1
ii  libwbclient0         2:4.5.12+dfsg-2+deb9u1
ii  lsb-base             9.20161125
ii  procps               2:3.3.12-3
ii  python               2.7.13-2
ii  python-dnspython     1.15.0-1
ii  python-samba         2:4.5.12+dfsg-2+deb9u1
ii  python2.7            2.7.13-2+deb9u2
ii  samba-common         2:4.5.12+dfsg-2+deb9u1
ii  samba-common-bin     2:4.5.12+dfsg-2+deb9u1
ii  samba-libs           2:4.5.12+dfsg-2+deb9u1
ii  tdb-tools            1.3.11-2
ii  update-inetd         4.44

Versions of packages samba recommends:
ii  attr                1:2.4.47-2+b2
ii  logrotate           3.11.0-0.1
ii  samba-dsdb-modules  2:4.5.12+dfsg-2+deb9u1
ii  samba-vfs-modules   2:4.5.12+dfsg-2+deb9u1

Versions of packages samba suggests:
pn  bind9          <none>
pn  bind9utils     <none>
pn  ctdb           <none>
pn  ldb-tools      <none>
ii  ntp            1:4.2.8p10+dfsg-3+deb9u1
pn  smbldap-tools  <none>
pn  ufw            <none>
pn  winbind        <none>

-- no debconf information



More information about the Pkg-samba-maint mailing list