[Samba] why do file locks revert to root ( fairly long)
Bret Hughes
bhughes at elevating.com
Sun Mar 30 05:27:36 GMT 2003
I help an NT admin that has recently added a redhat 8.0 based samba
server to his network. the share is one that is a core service for the
operation of the business and has about 50 users constantly accessing
data from several accounting and tax preparation applications.
One of the primary applications requires update farily recently as of
late and the admin is having problems getting all files in a specific
directory to release so they can be updated.
Procedure is that all users are asked to close the application and even
when they have all shut down the app, lsof still reports files in use by
smbd processes owned by root. Under normal circumstances lsof reports
files in use for the user logged on and usually several root owned
processes as well.
If I take the smbd pids that are there as root and grep the output of
netstat -ap I see that the smbd network connection is still active to
the machine.
What state is this process in? Is there some caching that occurs for a
period of time that allows the user to reattach to the smbd process or
what?
What is the best way to nicely clean up these processes?
Any insight appreciated.
Bret
here is some info
Inorder to track this down I use the following script
#!/bin/bash
DIR="/apps/Lacerte/02tax/"
#DIR="/var"
echo "All users with locks in $DIR"
declare -a PIDS
lsof +D $DIR |awk '{print $2 " " $3}'|sort -nu
echo "netstat connections for root owned pids"
PIDS=($(lsof +D $DIR |awk '/root/ {print $2}' |sort -u))
for pid in ${PIDS[*]}; do
netstat -ap |grep $pid; done
exit
Here is the output that illustrates the issue.
[root at solin bin]# lacerteuser.sh
All users with locks in /apps/Lacerte/02tax/
PID USER
4320 root
netstat connections for root owned pids
tcp 0 0 solin.inter:netbios-ssn SANDYSI.internal.s:2859 ESTABLISHED 4320/smbd
udp 0 0 localhost.localdo:32936 *:* 4320/smbd
unix 3 [ ] STREAM CONNECTED 85701 4320/smbd
[root at solin bin]# smbstatus
Samba version 2.2.7
Service uid gid pid machine
----------------------------------------------
APPS DOMAIN+sandy DOMAIN+Domain Users 4320 sandysi (10.0.0.208) Tue Mar 25 09:59:27 2003
APPS DOMAIN+Jim DOMAIN+Domain Users 1665 stantest2k (10.0.0.190) Fri Mar 28 14:47:33 2003
APPS DOMAIN+ron DOMAIN+Domain Users 25387 rone (10.0.0.195) Thu Mar 27 09:07:47 2003
APPS DOMAIN+John DOMAIN+Domain Users 3550 johng (10.0.0.187) Sat Mar 29 08:56:03 2003
IPC$ DOMAIN+Jim DOMAIN+Domain Users 18723 jims (10.0.0.207) Thu Mar 27 10:17:04 2003
APPS DOMAIN+Jim DOMAIN+Domain Users 18723 jims (10.0.0.207) Wed Mar 26 15:32:04 2003
ADMIN DOMAIN+Jim DOMAIN+Domain Users 18723 jims (10.0.0.207) Wed Mar 26 16:02:16 2003
Locked files:
Pid DenyMode Access R/W Oplock Name
--------------------------------------------------------------
4320 DENY_NONE 0x20089 RDONLY EXCLUSIVE+BATCH /apps/Lacerte/02tax/ind/usoutput.i02 Sat Mar 29 18:01:46 2003
4320 DENY_NONE 0x20089 RDONLY EXCLUSIVE+BATCH /apps/Lacerte/02tax/OPTION02/OPT019.W2 Sat Mar 29 18:01:45 2003
4320 DENY_NONE 0x20089 RDONLY NONE /apps/Lacerte/02tax/opdata.w2 Fri Mar 28 17:37:05 2003
4320 DENY_ALL 0x2019f RDWR NONE /apps/Lacerte/02tax/OPTION02/SID019A.w2 Fri Mar 28 17:37:05 2003
4320 DENY_WRITE 0x20 RDONLY NONE /apps/Lacerte/02tax/engine02.dll Fri Mar 28 17:37:07 2003
4320 DENY_NONE 0x2019f RDWR NONE /apps/Lacerte/02tax/OPTION02/RECURRG2.MDX Fri Mar 28 17:37:06 2003
4320 DENY_WRITE 0x20 RDONLY EXCLUSIVE+BATCH /apps/Lacerte/02tax/ind/i2usfunc.dll Sat Mar 29 18:01:45 2003
4320 DENY_NONE 0x2019f RDWR EXCLUSIVE+BATCH /apps/Lacerte/02tax/IDATA/DATA1I02.MDX Sat Mar 29 18:01:51 2003
4320 DENY_NONE 0x20089 RDONLY NONE /apps/Lacerte/02tax/OPTION02/WURN.W2 Fri Mar 28 17:37:04 2003
4320 DENY_NONE 0x20089 RDONLY NONE /apps/Lacerte/02tax/URN.W2 Fri Mar 28 17:37:05 2003
4320 DENY_NONE 0x2019f RDWR NONE /apps/Lacerte/02tax/OPTION02/RECURRG2.DBF Fri Mar 28 17:37:06 2003
4320 DENY_NONE 0x20089 RDONLY EXCLUSIVE+BATCH /apps/Lacerte/02tax/ind/uscodes.i02 Sat Mar 29 18:01:51 2003
4320 DENY_NONE 0x2019f RDWR NONE /apps/Lacerte/02tax/OPTION02/APTG2.MDX Fri Mar 28 17:37:06 2003
4320 DENY_WRITE 0x20 RDONLY EXCLUSIVE+BATCH /apps/Lacerte/02tax/ind/i2usdiag.dll Sat Mar 29 18:01:46 2003
4320 DENY_NONE 0x2019f RDWR NONE /apps/Lacerte/02tax/IDATA/DATA1I02.DBF Sat Mar 29 18:01:51 2003
4320 DENY_NONE 0x2019f RDWR NONE /apps/Lacerte/02tax/IDATA/DATA1I02.DBF Sat Mar 29 18:01:50 2003
4320 DENY_WRITE 0x20 RDONLY EXCLUSIVE+BATCH /apps/Lacerte/02tax/ind/i2us.dll Sat Mar 29 18:01:45 2003
4320 DENY_NONE 0x2019f RDWR NONE /apps/Lacerte/02tax/OPTION02/APTG2.DBF Fri Mar 28 17:37:06 2003
4320 DENY_NONE 0x20089 RDONLY EXCLUSIVE+BATCH /apps/Lacerte/02tax/ind/uswosi.i02 Sat Mar 29 18:01:51 2003
More information about the samba
mailing list