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

Martin Steigerwald martin.steigerwald at teamix.de
Thu Feb 23 12:46:39 UTC 2017


Package: samba
Version: 2:4.5.4+dfsg-1
Severity: important

Dear Maintainer,

I upgraded a fileserver VM hosted by Proxmox with KVM on VMware ESX
(nested virtualization) from Jessie to Stretch.

Since then afrter rebooting the fileserver VM smbd service does
not respond to connection request unless restarted.

This is a training / demonstration setup.


# How to reproduce
- Install and configure Samba on Stretch
- Reboot


# Actual results
Since then after rebooting the fileserver VM the Samba smbd service
does not seem to be operational:

root at webserver01:~# smbclient -L fileserver
Enter root's password:
Connection to fileserver failed (Error NT_STATUS_CONNECTION_REFUSED)

Systemd is happy tough:

root at fileserver:~# systemctl is-system-running
running

root at fileserver:~# systemctl status smbd
● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2017-02-23 13:32:56 CET; 2min 37s ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 545 (smbd)
   Status: "smbd: ready to serve connections..."
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/smbd.service
           ├─545 /usr/sbin/smbd
           ├─548 /usr/sbin/smbd
           ├─549 /usr/sbin/smbd
           └─554 /usr/sbin/smbd

Feb 23 13:32:56 fileserver systemd[1]: Starting Samba SMB Daemon...
Feb 23 13:32:56 fileserver systemd[1]: Started Samba SMB Daemon.

root at fileserver:~# systemctl status nmbd
● nmbd.service - Samba NMB Daemon
   Loaded: loaded (/lib/systemd/system/nmbd.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2017-02-23 13:32:56 CET; 3min 5s ago
     Docs: man:nmbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 584 (nmbd)
   Status: "nmbd: ready to serve connections..."
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/nmbd.service
           └─584 /usr/sbin/nmbd

Feb 23 13:32:56 fileserver systemd[1]: Starting Samba NMB Daemon...
Feb 23 13:32:56 fileserver systemd[1]: nmbd.service: Supervising process 584 which is not our child. We'll most likely not notice when it exits
Feb 23 13:32:56 fileserver systemd[1]: Started Samba NMB Daemon.

Ports are open, but 445 is only listening ton localhost:

root at fileserver:~# netstat -tulpen | grep mbd
tcp   0  0 127.0.0.1:445      0.0.0.0:*  LISTEN 0 16837 545/smbd            
tcp   0  0 127.0.0.1:139      0.0.0.0:*  LISTEN 0 16838 545/smbd            
tcp6  0  0 ::1:445            :::*       LISTEN 0 16839 545/smbd            
tcp6  0  0 ::1:139            :::*       LISTEN 0 16840 545/smbd            
udp   0  0 10.99.99.255:137   0.0.0.0:*         0 17209 584/nmbd            
udp   0  0 10.99.99.90:137    0.0.0.0:*         0 17208 584/nmbd            
udp   0  0 0.0.0.0:137        0.0.0.0:*         0 17198 584/nmbd            
udp   0  0 10.99.99.255:138   0.0.0.0:*         0 17211 584/nmbd            
udp   0  0 10.99.99.90:138    0.0.0.0:*         0 17210 584/nmbd            
udp   0  0 0.0.0.0:138        0.0.0.0:*         0 17199 584/nmbd


# Work-around
Connection works after restarting smbd:

root at webserver01:~# smbclient -L fileserver                                                                                                    
Enter root's password: 
Anonymous login successful
Domain=[DEMOTUXDC] OS=[Windows 6.1] Server=[Samba 4.5.4-Debian]

        Sharename       Type      Comment
        ---------       ----      -------
        web2data        Disk      Webserver data
        IPC$            IPC       IPC Service (Samba 4.5.4-Debian)
Anonymous login successful
Domain=[DEMOTUXDC] OS=[Windows 6.1] Server=[Samba 4.5.4-Debian]

        Server               Comment
        ---------            -------
        FILESERVER           Samba 4.5.4-Debian

        Workgroup            Master
        ---------            -------
        DEMOTUXDC            FILESERVER

When I restart is with systemctl I get same open ports. I.e.
445 is still on localhost and thus it does not seem to be needed
on client machine.


# Expected results
Samba smbd service works directly after reboot.


Note: Client webserver01 is still Jessie, not yet upgraded to Stretch.
But same happens when trying smbclient -L locally on fileserver itself.


# Configuration
Configuration of Samba is very simple at the moment:

root at fileserver:~# testparm                                                                                                                    Load smb config files from /etc/samba/smb.conf                                                                                                 rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)                                                                      WARNING: The "syslog" option is deprecated                                                                                                     Processing section "[homes]"                                                                                                                   Processing section "[web2data]"                                                                                                                Loaded services file OK.                                                                                                                       Server role: ROLE_STANDALONE                                                                                                                                                                                                                                                                  Press enter to see a dump of your service definitions  
                                                                                                                                               
# Global parameters                                                                                                                            

[global]                                                                                                                                       
        bind interfaces only = Yes                                                                                                             
        interfaces = lo eth0
        workgroup = DEMOTUXDC
        log file = /var/log/samba/log.%m
        max log size = 1000
        syslog = 0
        panic action = /usr/share/samba/panic-action %d
        obey pam restrictions = Yes
        security = USER
        server role = standalone server
        idmap config * : backend = tdb

[homes]
        comment = Home Directories
        browseable = No
        create mask = 0700
        directory mask = 0700
        valid users = %S

[web2data]                                                                                                                                             comment = Webserver data                                                                                                                       path = /srv/files/web2                                                                                                                         create mask = 0640                                                                                                                             directory mask = 0750                                                                                                                          force group = www-data                                                                                                                         read only = No                                                                                                                                 valid users = web2 

Thanks,
Martin

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

Kernel: Linux 4.9.0-1-amd64 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.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.22
ii  init-system-helpers  1.47
ii  libbsd0              0.8.3-1
ii  libc6                2.24-9
ii  libldb1              2:1.1.27-1
ii  libpam-modules       1.1.8-3.5
ii  libpam-runtime       1.1.8-3.5
ii  libpopt0             1.16-10
ii  libpython2.7         2.7.13-2
ii  libtalloc2           2.1.8-1
ii  libtdb1              1.3.11-2
ii  libtevent0           0.9.31-1
ii  libwbclient0         2:4.5.4+dfsg-1
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.4+dfsg-1
pn  python2.7:any        <none>
pn  python:any           <none>
ii  samba-common         2:4.5.4+dfsg-1
ii  samba-common-bin     2:4.5.4+dfsg-1
ii  samba-libs           2:4.5.4+dfsg-1
ii  tdb-tools            1.3.11-2
ii  update-inetd         4.44

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

Versions of packages samba suggests:
pn  bind9          <none>
pn  bind9utils     <none>
pn  ctdb           <none>
pn  ldb-tools      <none>
pn  ntp | chrony   <none>
pn  smbldap-tools  <none>
pn  ufw            <none>
pn  winbind        <none>

-- no debconf information


More information about the Pkg-samba-maint mailing list