The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
fuser adrianlearnpro UNIX for Dummies Questions & Answers 8 03-11-2009 12:05 PM
help needed in fuser command anju Shell Programming and Scripting 1 02-20-2008 02:08 AM
fuser ?? Look at the script !! varungupta UNIX for Advanced & Expert Users 0 08-31-2007 07:27 AM
make fuser send SIGTERM? adamides HP-UX 4 03-08-2007 10:57 AM
fuser brought down the box bandaru AIX 5 08-03-2005 09:39 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-06-2005
vibhor_agarwali vibhor_agarwali is offline
Registered User
  
 

Join Date: Jan 2005
Posts: 259
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 and therefore i won't be able to cat. But what does stop mean and how can i resume it.

Further fuser showed me that process was writing in the file by the suffix "o", but on running it a few times i got the same result.
My background process stopped.
I wanted to check via fuser whether that file is being used in a script and then do some processing from it.

Please help
  #2 (permalink)  
Old 04-06-2005
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
i believe you have run into a problem wiht opening an active file.

When you cat a file, it is not like tail -f, which allows you to continue viewing updated data in the file. Cat shows you the file at the instant it is viewed with cat. So it would make sense that your copy would "stop" at a certain point. You would have to cat the file again and again and again, over and over to continue viewing the additions to the file.

I think tail -f <filename> would be a better use.
  #3 (permalink)  
Old 04-07-2005
vibhor_agarwali vibhor_agarwali is offline
Registered User
  
 

Join Date: Jan 2005
Posts: 259
Oops,

You totally misunderstood me, what you are talking about is perfeclty ok.

But when i do a Cat, the background process which was writing to that file stopped. ( I found out this by doing a ps -ef | grep name_of_bak_ground )

It showed stopped, whats this stopped and it never resumed.
I thought to do a fuser, so when the process is not writing then i should Cat the file, but on using fuser the same thing happened.
My backgournd process stopped again. Why?

I can;t do a tail because i need the whole file, so what should i do now.
  #4 (permalink)  
Old 04-07-2005
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
  
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 637
what is the background process doing with the file you're trying to view? how do you start the background job? please post your command line ...
  #5 (permalink)  
Old 04-07-2005
vibhor_agarwali vibhor_agarwali is offline
Registered User
  
 

Join Date: Jan 2005
Posts: 259
My background process is writing to that file.
Something like
prstat -n 5 >> file &

This is executed every minute.
  #6 (permalink)  
Old 04-07-2005
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
  
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 637
i just tried that line on a solaris 8 box and it stayed running in the background even after several "cat file" ... try this and see if it helps ...

Code:
prstat -n 5 < /dev/null  >> file &

  #7 (permalink)  
Old 04-07-2005
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
  
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 637
Quote:
Originally Posted by vibhor_agarwali
This is executed every minute.
btw, the job stayed running the whole time on my test box ... there should be no need to rerun the job every minute ... however, verify for your os platform ...
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0