← Back to team overview

enterprise-support team mailing list archive

Re: [Question #176067]: Obtaining valid status about active connections

 

Question #176067 on samba in Ubuntu changed:
https://answers.launchpad.net/ubuntu/+source/samba/+question/176067

Description changed to:
I have a file server, built to be solar powered.  It is powered up by  a
WOL magic packet, and a little daemon I have written starts to count
down.  When it gets to zero it suspends.  Every second the daemon
monitors for valid activity and restarts the countdown if the server is
in use.  The indications of valid activity are : 'who' count > 0, number
of rysnc running >0, and number of active samba connections open >0.


Details
---------
It is the samba connection that is causing me trouble.  The test is actually `smbstatus | grep \: -c`.  It ignores the various header lines in the default smbstatus output, and counts those with a time delimiter as active connections.

This works fine with a Windows client, and used to work fine with an
Ubunutu client, but that second case is no longer true.    I have two
text files which tell the story: with a windows client closing the
windows file explorer closes the last connection.  In Ubuntu, closing
the Natuilus file explorer leaves the last connection running.  If  go
to look at /proc/<process no>/net/tcp it is not changing.  So there is
no traffic, but the connection is still open.

If I kill either the process listed in smbstatus at the server end, or
the one listed as gvfsd-smb at the client end, then it all settles down
and no harm is done: the countdown resumes because of my smbstatus |
grep test, and if I try to open a new connection it opens normally.

I cannot differentiate when samba is in use or idle when the client is
Ubuntu, only when it is Windows.

Question
-------------
So that is my question: 
How, at the server end, do I reliably detect that a samba connection is in use?

Supplementary
------------------
Out of curiosity:
Why does samba lock directories when opened in a client windows file navigator, but not an ubuntu one?
Why does samba not lock a text file when opened with a text editor from either type of client?

========================================
I cannot attach files, so I will add them as subsequent comments
=======================================

-- 
You received this question notification because you are a member of
Ubuntu Server/Client Support Team, which is an answer contact for samba
in Ubuntu.