Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Finding processes on another system that have a file open Post 302844234 by RudiC on Saturday 17th of August 2013 01:50:52 PM
Old 08-17-2013
Why do you suspect a process holding a file open when your list is empty?

If there are open files, there must be process(es) on the local side holding the files open; it might be children (or so) of the NFS daemon. Did you check the NFS log files?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to obtain system open file table value in Linux

Hello , I want to get current system open file table value. Can any one help. Thanking you, mahesh (0 Replies)
Discussion started by: mahesh.
0 Replies

2. UNIX for Dummies Questions & Answers

Finding unix file system

Hi, I have here a hard drive from a computer that was damaged, and now the costumer needs the data on the hard drive, but doesn't have any other computer to read data. I don't really know what file system is on the disk. How can I find out what file system is on the disk so I can read the... (4 Replies)
Discussion started by: dmarques
4 Replies

3. UNIX for Dummies Questions & Answers

Finding out which file system a machine has

Hi, when I run sfdisk -l get: Disk /dev/sda: 19452 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sda1 * 0+ 12 13- 104391 83 Linux... (1 Reply)
Discussion started by: mojoman
1 Replies

4. 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

5. Shell Programming and Scripting

Finding the age of a unix process, killing old processes, killing zombie processes

I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time. Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies

6. UNIX for Advanced & Expert Users

AIX: Finding processes attached to shared memory

Is there some way to tell what processes are attached to a shared memory segment? We have a system on which I perform "icps -ma" and there are several segments pending deletion having numerous processes attached to them and I can't tell what processes they are. Neither the creator's pid nor last... (7 Replies)
Discussion started by: DreamWarrior
7 Replies

7. Shell Programming and Scripting

Discrepancy in finding the top memory consuming processes

When I run 'top' command,I see the following Memory: 32G real, 12G free, 96G swap free Though it shows as 12G free,I am not able to account for processes that consume the rest 20G. In my understanding some process should be consuming atleast 15-16 G but I am not able to find them. Is... (1 Reply)
Discussion started by: prasperl
1 Replies

8. Shell Programming and Scripting

Quick question about finding the PID of long-running processes

The end result that I'd like is to terminate any process on my ps -u username list that extends beyond 20 minutes. I know for a fact that this process will be named l.exe, but I don't know the number in between and I won't know the PID. Is there a way to use grep or pidof to do this task every 20... (2 Replies)
Discussion started by: Bolanok
2 Replies

9. UNIX for Dummies Questions & Answers

Finding the most memory consuming processes in Linux

Platform: Oracle Linux 6.4 To find the most memory consuming processes, I tried the following 2 methods 1. Method1 # ps aux | head -1 ; ps aux | sort -nk +4 | tail -7 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 95 0.0 0.0 0 0 ? ... (2 Replies)
Discussion started by: kraljic
2 Replies

10. Solaris

Solaris zones - checking processes and lofs file system

Hi all, q1) If i am in a global-zone, is there any command or anyway to check if a particular process in "ps -ef" output is running in which zone ? q2) if i have created and mount a lofs filesystem/mountpoint for my non-global zone, can i say the following e.g. /dev/md/dsk/d60 /data --... (1 Reply)
Discussion started by: javanoob
1 Replies
flock(2)							System Calls Manual							  flock(2)

NAME
flock() - apply or remove an advisory or enforced lock on an open file SYNOPSIS
Parameters filedes Specifies a file descriptor returned by a successful or function, identifying the file on which the locking operation is to be performed. operation Specifies one of the following constants for defined in the file: Apply a shared lock. Apply an exclusive lock. Remove a lock. In addition to the preceding constants, the following constant can be bitwise ORed with either or LOCK_NB Do not block when locking. DESCRIPTION
The function applies or removes an advisory or enforced lock on the whole file associated with the filedes file descriptor. Advisory locks allow cooperating processes to perform consistent operations on files, but do not guarantee consistency (that is, processes may still access files without using advisory locks, possibly resulting in inconsistencies).Enforced locks are in effect if the enforcement bit in the file mode is set (see chmod(2)). This might affect and other system calls performing file operations. You can use the function to coordinate a file's lock status on local and NFS file systems. The locking mechanism allows two types of locks: and At any time multiple shared locks may be applied to a file, but at no time are multi- ple exclusive locks or both shared and exclusive locks allowed simultaneously on a file. A shared lock may be upgraded to an exclusive lock, and vice versa, simply by specifying the appropriate lock type. This results in the previous lock being released and the new lock applied (possibly after other processes have gained and released the lock). Requesting a lock on an object that is already locked normally causes the caller to be blocked until the lock may be acquired. If is included in operation, this will not happen; instead, the call will fail and will be set to APPLICATION USAGE
Locks are on files, not file descriptors. This means that: o Locks are not inherited by a child process resulting from a call. o All locks associated with a file for a given process are removed when any thread in the process closes any file descriptor for that file. Processes that are blocked awaiting a lock may be awakened by signals. An application needs to check the return value to make sure that the lock is really acquired. The interface is not part of any UNIX standard. Therefore, if you are designing and writing applications to be portable across platforms, you should use the file locking interface instead of NETWORKING FEATURES
NFS The advisory file locking capabilities of are implemented throughout the network by the network lock daemon If the file server crashes and is rebooted, the lock daemon attempts to recover all locks associated with the crashed server. If a lock cannot be reclaimed, the process that held the lock is issued a signal. See lockd(1M). File locking as implemented for NFS files is only advisory. RETURN VALUES
flock() returns: for successful completion for unsuccessful completion; is set to indicate the error ERRORS
If the function fails, may be set to one of the following values: The filedes parameter is not a valid open file descriptor. A shared lock was requested and filedes was not opened for reading, or an exclusive lock was requested and filedes was not opened for writing. The lock is blocked by some lock from another process. Putting the calling process to sleep while waiting for that lock to become free would cause a deadlock. A signal interrupted the call. The filedes parameter refers to a file that does not support locking. The operation parameter is not valid. The lock table is full. Too many files are already locked. The filedes parameter refers to an NFS file with the access bits set for enforcement mode. The filedes parameter refers to an NFS file, and a system error occurred on the remote node. The file is locked and the option was specified. The file is mapped into virtual memory via the system call (see mmap(2)). SEE ALSO
lockd(1M) chmod(2), close(2), creat(2), dup(2), dup2(2), exec(2), fcntl(2), fork(2), lockf(2), open(2), read(2), truncate(2), write(2). STANDARDS CONFORMANCE
flock(2)
All times are GMT -4. The time now is 08:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy