Sponsored Content
Special Forums Hardware Filesystems, Disks and Memory finding out the pid for a busy text file Post 23783 by Perderabo on Friday 28th of June 2002 10:51:43 PM
Old 06-28-2002
fuser may be able to do this. This public domain program lsof certainly can.

But the usual solution is to move the busy file out of the way. Something like...
mv /usr/local/bin/prog /usr/local/bin/prog.old
mv prog /usr/local/bin

And then later...
rm /usr/local/bin/prog.old
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding out if there is text in a file.

I have a script that when run creates 4 other text files. Sometimes a couple of these text files are empty. So what I am trying to do is find out if there is text in the file and if not delete the file. What I have so far is the following script. I am just not sure how to return a true value... (9 Replies)
Discussion started by: iCONAN
9 Replies

2. UNIX for Dummies Questions & Answers

finding text in a file

How do i find text string in a file if i have no idea where the file is? What I am trying to do is find an email address in a file and have no idea where the file is. Thanks (5 Replies)
Discussion started by: §ynic
5 Replies

3. Shell Programming and Scripting

Finding the nice(ni) number with PID?

Hi, is there a command that takes the PID of a process and that only diplays it's ni number? I`m pretty sure it would require pipes but I tried a few things that ended up miserably... Since the ps command doesn't show the ni unless I do ps -o ni but then I can't find a way to search the right... (2 Replies)
Discussion started by: Yakuzan
2 Replies

4. Shell Programming and Scripting

Finding PID of a process using variable substituition

Hi All, Am copying mulitple files in a directory in names File0,File1,File2 etc. I need to print separately the PID of these copies using File names. for((i=0;i<5;i++)) do mypid=`ps aux | awk '/File$i/ && !/awk/ { print $2 }'` echo PID is $mypid done It printed nothing. Thinking... (6 Replies)
Discussion started by: amio
6 Replies

5. UNIX for Advanced & Expert Users

Filesystem mystery: disks are not busy on one machine, very busy on a similar box

Hi, We have a filesystem mystery on our hands. Given: 2 machines, A and Aa. Machine Aa is the problem machine. Machine A is running Ubuntu, kernel 2.6.22.9 #1 SMP Wed Feb 20 08:46:16 CST 2008 x86_64 GNU/Linux. Machine Aa is running RHEL5.3, kernel 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38... (2 Replies)
Discussion started by: mschwage
2 Replies

6. Solaris

Finding PID of Killing process

Say I have 2 processes(perl scripts on Solaris machine) A and B. the process A kill the process B. While in the process B how do I print the PID of the process that Killed it(process A) before dieing. My process A looks like open(STATS, "ps -ef|"); while ($inputLine = <STATS>) { if... (7 Replies)
Discussion started by: enigma_007
7 Replies

7. Solaris

Finding most busy file system

Hi Experts, I was asked to find most busy file system on one of the server. It is Sun 10. Any idea to get this? Thanks, Deepak (5 Replies)
Discussion started by: naw_deepak
5 Replies

8. Shell Programming and Scripting

Help with finding text in file

Hello, Please help me with this. I have two files. file1.txt and file2.txt File1 contains text as below txt1 txt2 txt3 txt4 txt5 txt6 txt7 txt8 File2 contains text as below $1 $2 $3 $4 $5 $6 $7 $8 $9 ----------------------------- txt1 txt2 - - - 0 2 8 -*- txt0 txt7 - - - 1 4 8... (3 Replies)
Discussion started by: tenderfoot
3 Replies

9. Shell Programming and Scripting

Error in finding the PID by grep and assigning to a variable

Hello All, I am facing difficulty in getting the PID value & then assigning it to a variable, kindly help me in resolving the issue. Thanks a lot in advance. The custom utility used inside the Test2.sh will process the file in a batch of 10 lines at once and for efficient memory management,... (3 Replies)
Discussion started by: duddukuri
3 Replies

10. Shell Programming and Scripting

Help with finding the exit status of a 'nohup' command using 'PID'.

Hello All, I need to run a set of scripts, say 50 of them, parallely. I'm running these 50 scripts, from inside a script with the help of 'nohup' command. 1.The fifty scripts are stored in a separate file. 2.In a master script, i'm reading every line of the file through loop and executing... (4 Replies)
Discussion started by: SriRamKrish
4 Replies
VM_PAGE_GRAB(9) 					   BSD Kernel Developer's Manual					   VM_PAGE_GRAB(9)

NAME
vm_page_grab -- returns a page from an object SYNOPSIS
#include <sys/param.h> #include <vm/vm.h> #include <vm/vm_page.h> vm_page_t vm_page_grab(vm_object_t object, vm_pindex_t pindex, int allocflags); DESCRIPTION
The vm_page_grab() function returns the page at pindex from the given object. If the page exists and is busy, vm_page_grab() will sleep while waiting for it. If the page does not exist, it is allocated. The function sleeps until the allocation request can be satisfied. The function requires the object to be locked on entry, and returns with the object locked. If the vm_page_grab() function sleeps for any reason, the object lock is temporary dropped. The vm_page_grab() supports all of the flags supported by vm_page_alloc(9). In addition, vm_page_grab() supports the following flags: VM_ALLOC_IGN_SBUSY When waiting for the busy state of the existing page to drain, only test for exclusive busy; ignore the shared busy counter. RETURN VALUES
The vm_page_grab() always returns the page. SEE ALSO
vm_page_alloc(9) AUTHORS
This manual page was written by Chad David <davidc@acns.ab.ca>. BSD
August 23, 2013 BSD
All times are GMT -4. The time now is 08:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy