samba-users August 2010 archive
Main Archive Page > Month Archives  > samba-users archives
samba-users: Re: [Samba] HOWTO close session(s) to a specific sh

Re: [Samba] HOWTO close session(s) to a specific share from samba server side?

From: Andrew Masterson <Andrew.Masterson_at_nospam>
Date: Thu Aug 12 2010 - 21:00:41 GMT
To: "Jeremy Allison" <jra@samba.org>, "David Roid" <dataroid@gmail.com>

-----Original Message-----
From: samba-bounces@lists.samba.org
[mailto:samba-bounces@lists.samba.org] On Behalf Of Jeremy Allison
Sent: Wednesday, August 11, 2010 11:16 AM
To: David Roid
Cc: samba@lists.samba.org
Subject: Re: [Samba] HOWTO close session(s) to a specific share from
samba server side?

On Wed, Aug 11, 2010 at 04:18:48PM +0800, David Roid wrote:
> Hello list,
>
> I noticed that connections from the same client to different shares
have got
> the same pid on samba server, please refer to the out put below:
>
> # net status shares
> Service pid machine Connected at
> -------------------------------------------------------
> foo 1751 realone Thu Aug 12 07:38:49 2010
> bar 1751 realone Thu Aug 12 07:39:10 2010
>
> It seems there is no way to close session(s) to a specify share,
without
> hurting other stuff:
>
> 1. "kill -9" obvious is not an option, it will kill everything of that
pid.
> 2. "net rap session close <client>", it accepts an argument specifying
the
> client name. In this case I still lose both sessions.
>
> What I need here is a way to close sessions, no matter where they are
from,
> to a specific share; is there a fine grained command to do this?

smbcontrol close-share. Check the man page.

Jeremy.
---------

Unfortunately that closes the entire share, not an individual connection
to that share. I have fought with this before unless I'm missing
something.

Unlocking files is another impossible task unless (I think) you are
brave enough to edit the locks.tdb file.

I generally just script killing the PIDs as there's no other real way to
unlock stuff. The client end is usually robust enough to deal with it
unless it needs a stateful connection (which is usually database only
thing).

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