[Bug 1392647] Re: smbstatus reports dead connection as active
Konstantin Hollerith
1392647 at bugs.launchpad.net
Sun Dec 17 13:50:04 UTC 2017
I'm also using smbstatus to power of my server, if it's not in use, but
this bug prevents it.
I created this workaround script to ping the ip's (only ipv4) that
smbstatus reports, it reports the ip's as "online" or "offline". One
could also alter the script so the output is exactly like "smbstatus
-b", just showing the online clients only.
#!/bin/bash
# returns 1 if any smb client is online, otherwise 0
function pingClient
{
ping -c1 -W1 -q $1 &>/dev/null
status=$( echo $? )
if [[ $status == 0 ]] ; then
#ping success
echo "smb client $1 online"
return 1
else
#ping failure
echo "smb client $1 offline"
fi
}
sudo /usr/bin/smbstatus -b | grep -o -P "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" | sort | uniq | while read -r a; do pingClient $a; done
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to samba in Ubuntu.
https://bugs.launchpad.net/bugs/1392647
Title:
smbstatus reports dead connection as active
Status in samba package in Ubuntu:
Confirmed
Bug description:
I have a home server running ubuntu 14.04.1 LTS.
It was setup originally with ubuntu 12.04 LTS and running satisfactorily for more than 2 years
The server checks every 10 minutes and goes to sleep if no active clients are detected.
My main PC is a w7 box connecting to some samba shares on the server.
In the past 3 weeks it happened 3 times that the server reported an active samba connection although the client had long been shutdown.
At the first occurrence I set the deadtime parameter to 10 but this did not solve the problem.
The deadtime parameter was not there at all for the past 2 years and the problem only showed up lately so I think the cause of problem is somewhere else.
This is the output of smbstatus -v taken about 2 hours after the client has been powered off.
It should not show the 4366 PID lines.
Samba version 4.1.6-Ubuntu
PID Username Group Machine
-------------------------------------------------------------------
4366 father father 192.168.101.69 (ipv4:192.168.101.69:2132)
Opened /var/run/samba/connections.tdb
Service pid machine Connected at
-------------------------------------------------------
HomeServer 4366 192.168.101.69 Thu Nov 13 19:03:04 2014
Locked files:
Pid Uid DenyMode Access R/W Oplock SharePath Name Time
--------------------------------------------------------------------------------------------------
4366 1000 DENY_NONE 0x100081 RDONLY NONE /Data.Home . Thu Nov 13 19:03:04 2014
apt-cache policy samba reports
samba:
Installed: 2:4.1.6+dfsg-1ubuntu2.14.04.3
Candidate: 2:4.1.6+dfsg-1ubuntu2.14.04.3
Version table:
*** 2:4.1.6+dfsg-1ubuntu2.14.04.3 0
500 http://de.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
2:4.1.6+dfsg-1ubuntu2 0
500 http://de.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
My list of installed packages is attached.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1392647/+subscriptions
More information about the foundations-bugs
mailing list