Sponsored Content
Full Discussion: File Locks
Operating Systems HP-UX File Locks Post 302193460 by ismail.dhaoui on Friday 9th of May 2008 10:01:30 AM
Old 05-09-2008
Quote:
Originally Posted by jim mcnamara
lsof on HPUX is called fuser.
Just I would like say, that lsof and fuser are different.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

"File in use" - how to identify locks on this file and release them?

At times we see the "file in use" when we run RCS (revision conrol system" on this file. Most of time, we do not see this message. How do we identify the locks on this file and how do we release those locks? I can imagine it happens when there are some processes running on this file. THe... (1 Reply)
Discussion started by: vadimsf
1 Replies

2. Programming

Read/write locks within and between processes. Can you help?

I have an application that is multithreaded and concurrent. Multiple instances of the application must run at the same time. Each thread in each process accesses shared resources. For this purpose I've employed Butenhof's read-write locks. Inter-process locking is based on fcntl. For example,... (3 Replies)
Discussion started by: adamb
3 Replies

3. Solaris

Checking/ Releasing File Locks in Solaris

Hi, One of my prod jobs using Ab Initio (which is Solaris Based) returned this error: ========= Error from Reformat_3.000 on f7j21-01.xxxx3.com ========= Failed opening file for flow: Resource temporarily unavailable Flow = "Flow_11.000" connected to output port "out0" of "Reformat_3.000"... (0 Replies)
Discussion started by: teenu18
0 Replies

4. UNIX for Advanced & Expert Users

SCP / SFTP successful but locks out target account

Hi, We have an interesting problem with F-Secure SSH (v 3.1.0) running on HP-UX. It seems that when scp or sftp commands are issued they are successful but it counts as a 'strike' against the target user locking the account out after 3 attempts. When the user is re-enabled in SAM - it reports... (4 Replies)
Discussion started by: b0bbins
4 Replies

5. Linux

Whats for: /etc/locks directory?

Hi there! Can someone please tell me what is for the directory /etc/locks and provide me with an example. I certainly don't understand it very well. Any help will be much appreciated! (1 Reply)
Discussion started by: agasamapetilon
1 Replies

6. UNIX for Advanced & Expert Users

current locks on a file

I want to know all the locks on a file - read, write etc acquired by various processes. Is there any way to know ? (2 Replies)
Discussion started by: radiatejava
2 Replies

7. AIX

password locks after user killed

We are finding sometimes after a user process has been killed, when the user tries to reconnect, he gets the message that there has been too many attempts and his password is locked. Has anyone see this? AIX 5.3 tl9 sp3 thanks (0 Replies)
Discussion started by: MizzGail
0 Replies

8. Programming

help with write-read locks inter-process

I need help!Many Thanks! Now,I try to manage the shared memory inter-process . Inevitably,I have to deal with the synchronous. I know the pthread_rwlock in posix,and I compile ,then run successfully in Red Hat Enterprise 4. I have a doubt about whether the Posix supports the system such as... (1 Reply)
Discussion started by: weizh
1 Replies

9. Shell Programming and Scripting

How to avoid locks while loading database through UNIX script.?

Hi, I have the following requirement: I have load_cdr as main scriptwhich loads all the file records into vertica database through unix script. But there are two files which try to update same table..n thats y my script is getting failed... Can any1 give me some logic how to over come this... (6 Replies)
Discussion started by: gnnsprapa
6 Replies

10. Solaris

Passwd -f locks out login

hello; I have inherited a SunOS sjcorpftp 5.10 Generic_118855-36 i86pc i386 i86pc whenever someone needs a new password, I change it via "passwd username" then "passwd -f username" so they can change their password on my only sun sparc 5.9 you can "accessed denied" when you... (0 Replies)
Discussion started by: ikeleong
0 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:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy