FUSER problems


 
Thread Tools Search this Thread
Operating Systems Solaris FUSER problems
# 8  
Old 10-04-2010
Uhhm. Let me try and understand your findings. So, if i have a file that lives on machine A and is mounted. I have a process running on machine A that has the file opened. I issue an fuser from machine B, will I or will I not be able to get the process id and user id?

Thanks.....
Harleyrci
# 9  
Old 10-04-2010
Quote:
Originally Posted by Harleyrci
So, if i have a file that lives on machine A and is mounted.
mounted ? I guess you mean that file is shared.
Quote:
I have a process running on machine A that has the file opened.
Is machine A the NFS server ? That process is accessing a file located on a local file system, correct ?
Quote:
I issue an fuser from machine B, will I or will I not be able to get the process id and user id?
What is machine B ? You do not define its role here.
# 10  
Old 10-04-2010
Yes, machine A is the actual location of the file that is NFS mounted. FTP process runs on machine A, creating a file in ~/EBT/receive/some-name. On machine B, there is a daemon that issues fuser on that file every few minutes, all day long. If it finds a process id and user id it goes to sleep. Now my question is will fuser (issued on machine a on the NFS mounted file) bring back the user-id and process id of the process that has the file open?
Harleyrci
# 11  
Old 10-04-2010
Quote:
Originally Posted by Harleyrci
Greetings,
Thanks again for the support. The daemon issues an fuser on a file that is NFS mounted. So, (In theory) if a process has the file opened, the fuser would bring back the process id's and user-ids that have the file opened. It's a daemon process that was written before my time, and it has fallen on my lap to support. Currently, the daemon is moving grabbing files that are still being created by the FTP. Also, any ideas on how to identify if the FTP has not sent the complete file?
The only way fuser will find the processes that have the file open are if the fuser is run on the same machine as the process that has the file open. If the process is running on machine A and the file is on a file system that's actually located on and NFS shared from machine B, an fuser command run on machine B will not show the process on machine A.

There's lots of reasons why it works that way and for all practical purposes simply can't be made to work otherwise.

As for picking up incomplete files, the only one who can tell if the entire file has been sent is the sender. There's no way anyone receiving a file can tell if it's complete unless there's some passing of information in some way that indicates the file is complete.

One of the easiest ways is to have the sender rename the file from a name that indicates it's still being sent to a name that indicates that it's complete. Since a simple rename within one file system is an atomic operation on every sane file system, it's about the best way I know of to indicate that the file is completely sent.
# 12  
Old 10-04-2010
Thanks so much for the help. You really helped my understand this issue much better. My work around is to monitor the growth of the file. When it no longer increases then the daemon moves forward with processing any files it finds.
Harleyrci
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unable to get pid from fuser

bash-3.2$ fuser -f /bin/nohup.out /bin/nohup.out: 13136o 13111o The pid is 13136. Can you tell me how can i extract just the pid 13136 from the above output ? bash-3.2$ uname -a SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v I was trying on this lines but i get strange... (3 Replies)
Discussion started by: mohtashims
3 Replies

2. UNIX for Advanced & Expert Users

Fuser alternative OR running fuser on a script

Hi, Not sure whether there is a fuser alternative or any better way to check for file in use or not. I am wanting to check whether files are in use or not before removing them. Using fuser, the awk seems to be giving me 'weird' output not to mention that it is giving me 2 lines instead of... (0 Replies)
Discussion started by: newbie_01
0 Replies

3. AIX

Fuser on VXFS not reporting processes

I have a perl script like : #! /usr/bin/perl open FILE1,">/tmp/openfile.test.out"; open FILE2,"</tmp/openfile.test.in"; open FILE3,">/data/openfile.test.out"; open FILE4,"</data/openfile.test.in"; <STDIN>; close FILE1; close FILE2; close FILE3; close FILE4; /tmp is jfs2... (0 Replies)
Discussion started by: petervg
0 Replies

4. UNIX for Dummies Questions & Answers

fuser on aix vs. linux

Pls. advise why on AIX the exit status is always '0' and on Linux it is always '1' even if the I just created a new file. I'm thinking if there is a background process monitoring the created 'file1' on AIX even if it is just a dummy or new file. How can I resolve this. (I need to justify that... (1 Reply)
Discussion started by: budz26
1 Replies

5. UNIX for Dummies Questions & Answers

fuser

if filename.txt is in used, exit, else continue. i tried to use fuser -c filename.txt, but returned bunch out PIDs eventhough filename.txt is not in used. any idea ? (10 Replies)
Discussion started by: tjmannonline
10 Replies

6. UNIX for Dummies Questions & Answers

fuser

Anyone ever use fuser, i tried this command fuser /database.bk but it only returns datbase.bk: I read some of the forums online, one of them said when he used fuser, it broke down the box, i really don't want that happen. I thought fuser is to see who is accessing that file, right? any... (8 Replies)
Discussion started by: adrianlearnpro
8 Replies

7. Shell Programming and Scripting

help needed in fuser command

Hi all, I want to know if fuser command can be used to check if a file is being written or not??? Thanks In Advance Anju (1 Reply)
Discussion started by: anju
1 Replies

8. UNIX for Advanced & Expert Users

fuser ?? Look at the script !!

#SCRIPT TO CHECK WHO HAS ACCESSED THE LOG/FILE IN PAST 'N' MINUTES, AND MAIL ACCORDINGLY. MYPATH="/clocal/mqbrkrs/user/mqsiadm/sanjay/" MAIL_RECIPIENTS="abc@xyz.com" Subject="File accessed in last few minutes" >tempmail.txt >tempfind.txt find "$MYPATH" -type f -amin -1 > tempfind.txt cat... (0 Replies)
Discussion started by: varungupta
0 Replies

9. AIX

fuser brought down the box

I issued fuser -k -x -u ./amqcc_r It brought down the whole box The unix admin says if I had issued fuser -k -x -u amqcc_r then it would have not brouht down the box. Does it make sense to you guys (5 Replies)
Discussion started by: bandaru
5 Replies

10. UNIX for Dummies Questions & Answers

Help with fuser

fuser is used to check whether a file is in use by a process or not. I was putting some information in a file via a background process and was doing a cat to see the contents. It gave me the pid of background process followed by stop. Understood only half, stopped because it was writing on it... (11 Replies)
Discussion started by: vibhor_agarwali
11 Replies
Login or Register to Ask a Question