Re: [Samba] How to detect active users

2011-07-27 Thread Malte Forkel
Am 26.07.2011 19:27, schrieb Jeremy Allison:
 On Tue, Jul 26, 2011 at 07:18:15PM +0200, Malte Forkel wrote:
 Am 26.07.2011 19:08, schrieb John Drescher:
 On Tue, Jul 26, 2011 at 1:04 PM, Malte Forkel malte.for...@berlin.de 
 wrote:
 Am 26.07.2011 18:42, schrieb Chris Weiss:
 On Tue, Jul 26, 2011 at 3:06 AM, Malte Forkel malte.for...@berlin.de 
 wrote:
 Currently, I'm not even sure Samba preserves the kind of state
 information required to detect the usage scenario  I'm interested in. Is
 there any concept of an open file in Windows/Samba, after all? May be
 it depends on the application used to open the file?

 yes, it depends on the application.  If the app closes the file and
 leaves the share, samba honors that.  if the app keeps the file handle
 open, samba does too.

 So an application (like SciTE) might open a file, read and display its
 contents, and close the file while continuing to display it. And in
 contrast, a different application might not close the file while it is
 displaying its contents?

 Exactly.

 John

 Well, thanks to all of you for your help.

 In summary then, it looks to me like I won't be able to reliably detect
 if there is any client out there who would be disappointed if the server
 shuts down.
 
 Of course you will ! smbstatus does this as I keep repeating.
 If an application has opened and closed the file and keeps it
 in memory, then the user won't be disappointed if the server
 is shut down, they'll get an IO error on save and have to
 do a save as to a local (or other remote) drive.
 
 If an application keeps the file open (so it's not safely
 stored in memory) then smbstatus will show this and you
 don't shut the server down.
 
 You seem to think there's some magic option that will
 show you client intent, not client activity.
 
 Client activity is all you need to care about, and smbstatus
 show you this. Doesn't matter if applications are running
 or not, whether that have actual files open is all that
 matters.
 
 Jeremy.

Well, I guess some people get disappointed more easily than others :-)

I understand that users won't loose any data if the server shuts down
and they save as their changes. But having to re-synchronize those
files with those on the server once it is up again is something I'd like
to avoid.

Plus, the open files (from a user perspective) might just be an
indicator that the user would like to use other capabilities of the
server as well. E.g., he might do remote development of an application
on the server using Eclipse on the Windows machine. If I found out that
the server had shut down when I try to compile a new version (implicitly
saving changed files before), I'd be disappointed.

Malte


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-27 Thread Marcello Romani

Il 26/07/2011 10:06, Malte Forkel ha scritto:

Am 25.07.2011 23:34, schrieb Chris Weiss:

On Mon, Jul 25, 2011 at 3:50 PM, Pascal Valoispascal.val...@devinci.fr  wrote:

Le 25/07/11 22:44, Jeremy Allison a écrit :


On Mon, Jul 25, 2011 at 10:21:35PM +0200, Malte Forkel wrote:


Hi,

I'm running Samba 3.2.5 on a server which I'd like to shut down when it
is not used by any client.

Is there a way to detect whether any user has opened a file on the
server?


smbstatus will tell you.


slight correction,

smbstatus tells you what file are used and by who, currently.
not who HAS opened a file.


smbstatus will also tell you who has an active connection to what
shares, even if they have yet to actually open some file.

while it's possible for someone to open a file in app that reads to
ram then closes, such as notepad.exe, making edits and letting them
sit without saving for long enough that an smb client would disconnect
the session is unlikely given the save often mentality that most
have gotten from using PC's.  From application crashes, to power
outages, to 2 year old kids pressing buttons, save often!


Thanks for your suggestions!


so depending on what you mean by has opened (opened before and still
use it, or opened before and may have close it), smbstatus may be the
answer or not.


By has opened I mean opened before and still use it. Actually,
something more like would be disappointed if the server went down.
Ideally, a user might e.g. open a couple of source files to analyze them
and after a while (without making changes of saving anything) try to
open another file in the same directory.

I've done a couple of experiments with smbstatus, specifically its -S
and -L options. My clients run Windows 7 SP1 and Windows XP SP3. While a
Windows Expolores is opened for a share (or one of its subdirectories),
smbstatus -S will list that share. But once the Explorer is closed,
the entry is cleared. Similarly, using a File Open Dialog only produces
a short lived entry.

smbstatus -L does not seem to produce any list entries once a user has
opened a file. May be I have to specify some more specific locking in
smb.conf?

I've also experimented with root preexec and root postexec. Those
seem to be triggered at the same time the output of smbstatus -S changes.

Currently, I'm not even sure Samba preserves the kind of state
information required to detect the usage scenario  I'm interested in. Is
there any concept of an open file in Windows/Samba, after all? May be
it depends on the application used to open the file?




I suggest trying smbstatus -B too (shows byterange locks).

Also, reading the whole thread it seems to me (FWIW) that the only way 
to be 100% sure that a samba restart won't disappoint anyone is have 
smbstatus show no active connection.


--
Marcello Romani
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-27 Thread Aaron E.
clear the logs and monitor for a few days,, If there is not real 
activity just shut down the service and see if anyone complains they 
can't access something.. After a few days/weeks/months pull the server.


Might not be the perfect scenario but if smbstatus isn't displaying what 
you need then this might make you feel better about it lol


On 07/27/2011 04:33 AM, Malte Forkel wrote:

Am 26.07.2011 19:27, schrieb Jeremy Allison:

On Tue, Jul 26, 2011 at 07:18:15PM +0200, Malte Forkel wrote:

Am 26.07.2011 19:08, schrieb John Drescher:

On Tue, Jul 26, 2011 at 1:04 PM, Malte Forkelmalte.for...@berlin.de  wrote:

Am 26.07.2011 18:42, schrieb Chris Weiss:

On Tue, Jul 26, 2011 at 3:06 AM, Malte Forkelmalte.for...@berlin.de  wrote:

Currently, I'm not even sure Samba preserves the kind of state
information required to detect the usage scenario  I'm interested in. Is
there any concept of an open file in Windows/Samba, after all? May be
it depends on the application used to open the file?


yes, it depends on the application.  If the app closes the file and
leaves the share, samba honors that.  if the app keeps the file handle
open, samba does too.


So an application (like SciTE) might open a file, read and display its
contents, and close the file while continuing to display it. And in
contrast, a different application might not close the file while it is
displaying its contents?


Exactly.

John


Well, thanks to all of you for your help.

In summary then, it looks to me like I won't be able to reliably detect
if there is any client out there who would be disappointed if the server
shuts down.


Of course you will ! smbstatus does this as I keep repeating.
If an application has opened and closed the file and keeps it
in memory, then the user won't be disappointed if the server
is shut down, they'll get an IO error on save and have to
do a save as to a local (or other remote) drive.

If an application keeps the file open (so it's not safely
stored in memory) then smbstatus will show this and you
don't shut the server down.

You seem to think there's some magic option that will
show you client intent, not client activity.

Client activity is all you need to care about, and smbstatus
show you this. Doesn't matter if applications are running
or not, whether that have actual files open is all that
matters.

Jeremy.


Well, I guess some people get disappointed more easily than others :-)

I understand that users won't loose any data if the server shuts down
and they save as their changes. But having to re-synchronize those
files with those on the server once it is up again is something I'd like
to avoid.

Plus, the open files (from a user perspective) might just be an
indicator that the user would like to use other capabilities of the
server as well. E.g., he might do remote development of an application
on the server using Eclipse on the Windows machine. If I found out that
the server had shut down when I try to compile a new version (implicitly
saving changed files before), I'd be disappointed.

Malte




--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-27 Thread Jefferson Davis
I usually just use smbstatus. if I'm looking into a user issue, it's usually 
smbstatus | grep userid. Then I can get the PID and give it a kill -HUP to 
load new shares, etc, IF they don;t have any open files. 

- Original Message -

From: Aaron E. ssures...@gmail.com 
To: samba@lists.samba.org 
Sent: Wednesday, July 27, 2011 6:21:28 AM 
Subject: Re: [Samba] How to detect active users 

clear the logs and monitor for a few days,, If there is not real 
activity just shut down the service and see if anyone complains they 
can't access something.. After a few days/weeks/months pull the server. 

Might not be the perfect scenario but if smbstatus isn't displaying what 
you need then this might make you feel better about it lol 

On 07/27/2011 04:33 AM, Malte Forkel wrote: 
 Am 26.07.2011 19:27, schrieb Jeremy Allison: 
 On Tue, Jul 26, 2011 at 07:18:15PM +0200, Malte Forkel wrote: 
 Am 26.07.2011 19:08, schrieb John Drescher: 
 On Tue, Jul 26, 2011 at 1:04 PM, Malte Forkelmalte.for...@berlin.de 
 wrote: 
 Am 26.07.2011 18:42, schrieb Chris Weiss: 
 On Tue, Jul 26, 2011 at 3:06 AM, Malte Forkelmalte.for...@berlin.de 
 wrote: 
 Currently, I'm not even sure Samba preserves the kind of state 
 information required to detect the usage scenario I'm interested in. Is 
 there any concept of an open file in Windows/Samba, after all? May be 
 it depends on the application used to open the file? 
 
 yes, it depends on the application. If the app closes the file and 
 leaves the share, samba honors that. if the app keeps the file handle 
 open, samba does too. 
 
 So an application (like SciTE) might open a file, read and display its 
 contents, and close the file while continuing to display it. And in 
 contrast, a different application might not close the file while it is 
 displaying its contents? 
 
 Exactly. 
 
 John 
 
 Well, thanks to all of you for your help. 
 
 In summary then, it looks to me like I won't be able to reliably detect 
 if there is any client out there who would be disappointed if the server 
 shuts down. 
 
 Of course you will ! smbstatus does this as I keep repeating. 
 If an application has opened and closed the file and keeps it 
 in memory, then the user won't be disappointed if the server 
 is shut down, they'll get an IO error on save and have to 
 do a save as to a local (or other remote) drive. 
 
 If an application keeps the file open (so it's not safely 
 stored in memory) then smbstatus will show this and you 
 don't shut the server down. 
 
 You seem to think there's some magic option that will 
 show you client intent, not client activity. 
 
 Client activity is all you need to care about, and smbstatus 
 show you this. Doesn't matter if applications are running 
 or not, whether that have actual files open is all that 
 matters. 
 
 Jeremy. 
 
 Well, I guess some people get disappointed more easily than others :-) 
 
 I understand that users won't loose any data if the server shuts down 
 and they save as their changes. But having to re-synchronize those 
 files with those on the server once it is up again is something I'd like 
 to avoid. 
 
 Plus, the open files (from a user perspective) might just be an 
 indicator that the user would like to use other capabilities of the 
 server as well. E.g., he might do remote development of an application 
 on the server using Eclipse on the Windows machine. If I found out that 
 the server had shut down when I try to compile a new version (implicitly 
 saving changed files before), I'd be disappointed. 
 
 Malte 
 
 

-- 
To unsubscribe from this list go to the following URL and read the 
instructions: https://lists.samba.org/mailman/options/samba 

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-26 Thread Malte Forkel
Am 25.07.2011 23:34, schrieb Chris Weiss:
 On Mon, Jul 25, 2011 at 3:50 PM, Pascal Valois pascal.val...@devinci.fr 
 wrote:
 Le 25/07/11 22:44, Jeremy Allison a écrit :

 On Mon, Jul 25, 2011 at 10:21:35PM +0200, Malte Forkel wrote:

 Hi,

 I'm running Samba 3.2.5 on a server which I'd like to shut down when it
 is not used by any client.

 Is there a way to detect whether any user has opened a file on the
 server?

 smbstatus will tell you.

 slight correction,

 smbstatus tells you what file are used and by who, currently.
 not who HAS opened a file.
 
 smbstatus will also tell you who has an active connection to what
 shares, even if they have yet to actually open some file.
 
 while it's possible for someone to open a file in app that reads to
 ram then closes, such as notepad.exe, making edits and letting them
 sit without saving for long enough that an smb client would disconnect
 the session is unlikely given the save often mentality that most
 have gotten from using PC's.  From application crashes, to power
 outages, to 2 year old kids pressing buttons, save often!

Thanks for your suggestions!

 so depending on what you mean by has opened (opened before and still
 use it, or opened before and may have close it), smbstatus may be the
 answer or not.

By has opened I mean opened before and still use it. Actually,
something more like would be disappointed if the server went down.
Ideally, a user might e.g. open a couple of source files to analyze them
and after a while (without making changes of saving anything) try to
open another file in the same directory.

I've done a couple of experiments with smbstatus, specifically its -S
and -L options. My clients run Windows 7 SP1 and Windows XP SP3. While a
Windows Expolores is opened for a share (or one of its subdirectories),
smbstatus -S will list that share. But once the Explorer is closed,
the entry is cleared. Similarly, using a File Open Dialog only produces
a short lived entry.

smbstatus -L does not seem to produce any list entries once a user has
opened a file. May be I have to specify some more specific locking in
smb.conf?

I've also experimented with root preexec and root postexec. Those
seem to be triggered at the same time the output of smbstatus -S changes.

Currently, I'm not even sure Samba preserves the kind of state
information required to detect the usage scenario  I'm interested in. Is
there any concept of an open file in Windows/Samba, after all? May be
it depends on the application used to open the file?


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-26 Thread Jeremy Allison
On Tue, Jul 26, 2011 at 10:06:20AM +0200, Malte Forkel wrote:
 
 Currently, I'm not even sure Samba preserves the kind of state
 information required to detect the usage scenario  I'm interested in. Is
 there any concept of an open file in Windows/Samba, after all? May be
 it depends on the application used to open the file?

Yes, Samba keeps state on all open files. That's what smbstatus shows.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-26 Thread Chris Weiss
On Tue, Jul 26, 2011 at 3:06 AM, Malte Forkel malte.for...@berlin.de wrote:
 Currently, I'm not even sure Samba preserves the kind of state
 information required to detect the usage scenario  I'm interested in. Is
 there any concept of an open file in Windows/Samba, after all? May be
 it depends on the application used to open the file?

yes, it depends on the application.  If the app closes the file and
leaves the share, samba honors that.  if the app keeps the file handle
open, samba does too.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-26 Thread Malte Forkel
Am 26.07.2011 18:31, schrieb Jeremy Allison:
 On Tue, Jul 26, 2011 at 10:06:20AM +0200, Malte Forkel wrote:

 Currently, I'm not even sure Samba preserves the kind of state
 information required to detect the usage scenario  I'm interested in. Is
 there any concept of an open file in Windows/Samba, after all? May be
 it depends on the application used to open the file?
 
 Yes, Samba keeps state on all open files. That's what smbstatus shows.

Well, is it a problem with my Samba configuration then? Or a different
concept of open?

I just used SciTE (a text editor) on a Windows 7 PC to open a text file
on the server. When I ran smbstatus immediately after opening the file,
it showed entries for the share(s) and the file itself. When I called
smbstatus again about a minute later and while the editor window was
still open, those entries were gone again.


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-26 Thread Jeremy Allison
On Tue, Jul 26, 2011 at 06:54:07PM +0200, Malte Forkel wrote:
 Am 26.07.2011 18:31, schrieb Jeremy Allison:
  On Tue, Jul 26, 2011 at 10:06:20AM +0200, Malte Forkel wrote:
 
  Currently, I'm not even sure Samba preserves the kind of state
  information required to detect the usage scenario  I'm interested in. Is
  there any concept of an open file in Windows/Samba, after all? May be
  it depends on the application used to open the file?
  
  Yes, Samba keeps state on all open files. That's what smbstatus shows.
 
 Well, is it a problem with my Samba configuration then? Or a different
 concept of open?
 
 I just used SciTE (a text editor) on a Windows 7 PC to open a text file
 on the server. When I ran smbstatus immediately after opening the file,
 it showed entries for the share(s) and the file itself. When I called
 smbstatus again about a minute later and while the editor window was
 still open, those entries were gone again.

The editor closed the file in the meantime.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-26 Thread John Drescher
On Tue, Jul 26, 2011 at 12:54 PM, Malte Forkel malte.for...@berlin.de wrote:
 Am 26.07.2011 18:31, schrieb Jeremy Allison:
 On Tue, Jul 26, 2011 at 10:06:20AM +0200, Malte Forkel wrote:

 Currently, I'm not even sure Samba preserves the kind of state
 information required to detect the usage scenario  I'm interested in. Is
 there any concept of an open file in Windows/Samba, after all? May be
 it depends on the application used to open the file?

 Yes, Samba keeps state on all open files. That's what smbstatus shows.

 Well, is it a problem with my Samba configuration then? Or a different
 concept of open?

 I just used SciTE (a text editor) on a Windows 7 PC to open a text file
 on the server. When I ran smbstatus immediately after opening the file,
 it showed entries for the share(s) and the file itself. When I called
 smbstatus again about a minute later and while the editor window was
 still open, those entries were gone again.


This program could read the whole file to memory and close the file
allowing you to edit the closed file. Then when you save it could open
it again and save.

John
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-26 Thread Malte Forkel
Am 26.07.2011 18:42, schrieb Chris Weiss:
 On Tue, Jul 26, 2011 at 3:06 AM, Malte Forkel malte.for...@berlin.de wrote:
 Currently, I'm not even sure Samba preserves the kind of state
 information required to detect the usage scenario  I'm interested in. Is
 there any concept of an open file in Windows/Samba, after all? May be
 it depends on the application used to open the file?
 
 yes, it depends on the application.  If the app closes the file and
 leaves the share, samba honors that.  if the app keeps the file handle
 open, samba does too.

So an application (like SciTE) might open a file, read and display its
contents, and close the file while continuing to display it. And in
contrast, a different application might not close the file while it is
displaying its contents?

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-26 Thread Chris Weiss
On Tue, Jul 26, 2011 at 12:04 PM, Malte Forkel malte.for...@berlin.de wrote:
 Am 26.07.2011 18:42, schrieb Chris Weiss:
 On Tue, Jul 26, 2011 at 3:06 AM, Malte Forkel malte.for...@berlin.de wrote:
 Currently, I'm not even sure Samba preserves the kind of state
 information required to detect the usage scenario  I'm interested in. Is
 there any concept of an open file in Windows/Samba, after all? May be
 it depends on the application used to open the file?

 yes, it depends on the application.  If the app closes the file and
 leaves the share, samba honors that.  if the app keeps the file handle
 open, samba does too.

 So an application (like SciTE) might open a file, read and display its
 contents, and close the file while continuing to display it. And in
 contrast, a different application might not close the file while it is
 displaying its contents?

exactly.  Scite and notepad are known to close the file, Word and
Excel are known to keep the file open because they only read parts of
the file into ram.  not sure if that applies to .txt and .csv though,
but doc and xls for sure
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-26 Thread John Drescher
On Tue, Jul 26, 2011 at 1:04 PM, Malte Forkel malte.for...@berlin.de wrote:
 Am 26.07.2011 18:42, schrieb Chris Weiss:
 On Tue, Jul 26, 2011 at 3:06 AM, Malte Forkel malte.for...@berlin.de wrote:
 Currently, I'm not even sure Samba preserves the kind of state
 information required to detect the usage scenario  I'm interested in. Is
 there any concept of an open file in Windows/Samba, after all? May be
 it depends on the application used to open the file?

 yes, it depends on the application.  If the app closes the file and
 leaves the share, samba honors that.  if the app keeps the file handle
 open, samba does too.

 So an application (like SciTE) might open a file, read and display its
 contents, and close the file while continuing to display it. And in
 contrast, a different application might not close the file while it is
 displaying its contents?

Exactly.

John
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-26 Thread Malte Forkel
Am 26.07.2011 19:08, schrieb John Drescher:
 On Tue, Jul 26, 2011 at 1:04 PM, Malte Forkel malte.for...@berlin.de wrote:
 Am 26.07.2011 18:42, schrieb Chris Weiss:
 On Tue, Jul 26, 2011 at 3:06 AM, Malte Forkel malte.for...@berlin.de 
 wrote:
 Currently, I'm not even sure Samba preserves the kind of state
 information required to detect the usage scenario  I'm interested in. Is
 there any concept of an open file in Windows/Samba, after all? May be
 it depends on the application used to open the file?

 yes, it depends on the application.  If the app closes the file and
 leaves the share, samba honors that.  if the app keeps the file handle
 open, samba does too.

 So an application (like SciTE) might open a file, read and display its
 contents, and close the file while continuing to display it. And in
 contrast, a different application might not close the file while it is
 displaying its contents?
 
 Exactly.
 
 John

Well, thanks to all of you for your help.

In summary then, it looks to me like I won't be able to reliably detect
if there is any client out there who would be disappointed if the server
shuts down.


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-26 Thread Jeremy Allison
On Tue, Jul 26, 2011 at 07:18:15PM +0200, Malte Forkel wrote:
 Am 26.07.2011 19:08, schrieb John Drescher:
  On Tue, Jul 26, 2011 at 1:04 PM, Malte Forkel malte.for...@berlin.de 
  wrote:
  Am 26.07.2011 18:42, schrieb Chris Weiss:
  On Tue, Jul 26, 2011 at 3:06 AM, Malte Forkel malte.for...@berlin.de 
  wrote:
  Currently, I'm not even sure Samba preserves the kind of state
  information required to detect the usage scenario  I'm interested in. Is
  there any concept of an open file in Windows/Samba, after all? May be
  it depends on the application used to open the file?
 
  yes, it depends on the application.  If the app closes the file and
  leaves the share, samba honors that.  if the app keeps the file handle
  open, samba does too.
 
  So an application (like SciTE) might open a file, read and display its
  contents, and close the file while continuing to display it. And in
  contrast, a different application might not close the file while it is
  displaying its contents?
  
  Exactly.
  
  John
 
 Well, thanks to all of you for your help.
 
 In summary then, it looks to me like I won't be able to reliably detect
 if there is any client out there who would be disappointed if the server
 shuts down.

Of course you will ! smbstatus does this as I keep repeating.
If an application has opened and closed the file and keeps it
in memory, then the user won't be disappointed if the server
is shut down, they'll get an IO error on save and have to
do a save as to a local (or other remote) drive.

If an application keeps the file open (so it's not safely
stored in memory) then smbstatus will show this and you
don't shut the server down.

You seem to think there's some magic option that will
show you client intent, not client activity.

Client activity is all you need to care about, and smbstatus
show you this. Doesn't matter if applications are running
or not, whether that have actual files open is all that
matters.

Jeremy.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


[Samba] How to detect active users

2011-07-25 Thread Malte Forkel
Hi,

I'm running Samba 3.2.5 on a server which I'd like to shut down when it
is not used by any client.

Is there a way to detect whether any user has opened a file on the server?

Thanks,
Malte

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-25 Thread Jeremy Allison
On Mon, Jul 25, 2011 at 10:21:35PM +0200, Malte Forkel wrote:
 Hi,
 
 I'm running Samba 3.2.5 on a server which I'd like to shut down when it
 is not used by any client.
 
 Is there a way to detect whether any user has opened a file on the server?

smbstatus will tell you.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-25 Thread Pascal Valois

Le 25/07/11 22:44, Jeremy Allison a écrit :

On Mon, Jul 25, 2011 at 10:21:35PM +0200, Malte Forkel wrote:

Hi,

I'm running Samba 3.2.5 on a server which I'd like to shut down when it
is not used by any client.

Is there a way to detect whether any user has opened a file on the server?

smbstatus will tell you.

slight correction,

smbstatus tells you what file are used and by who, currently.
not who HAS opened a file.

so depending on what you mean by has opened (opened before and still 
use it, or opened before and may have close it), smbstatus may be the 
answer or not.


--
Pascal Valois
Service Informatique
Pôle Universitaire Léonard de Vinci

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] How to detect active users

2011-07-25 Thread Chris Weiss
On Mon, Jul 25, 2011 at 3:50 PM, Pascal Valois pascal.val...@devinci.fr wrote:
 Le 25/07/11 22:44, Jeremy Allison a écrit :

 On Mon, Jul 25, 2011 at 10:21:35PM +0200, Malte Forkel wrote:

 Hi,

 I'm running Samba 3.2.5 on a server which I'd like to shut down when it
 is not used by any client.

 Is there a way to detect whether any user has opened a file on the
 server?

 smbstatus will tell you.

 slight correction,

 smbstatus tells you what file are used and by who, currently.
 not who HAS opened a file.

smbstatus will also tell you who has an active connection to what
shares, even if they have yet to actually open some file.

while it's possible for someone to open a file in app that reads to
ram then closes, such as notepad.exe, making edits and letting them
sit without saving for long enough that an smb client would disconnect
the session is unlikely given the save often mentality that most
have gotten from using PC's.  From application crashes, to power
outages, to 2 year old kids pressing buttons, save often!
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba