Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: Tony Verhulst <verhulst@zk3.dec.com>
Subject: Re: How to identify locking process
Date: 2000/10/24	[thread overview]
Message-ID: <39F5F152.A7FFD89A@zk3.dec.com> (raw)
In-Reply-To: 8t4qi8$k99$1@infosun2.rus.uni-stuttgart.de

Stefan Schwarzer wrote:
> 
> We use an application (maple) that seems to rely on a (help) database
> which it locks during use. Somehow, such a lock does not have been
> properly removed maybe due to a crash, or a NFS locking problem or
> some other reason. Now, whenever I use the application, it freezes on
> me, probably waiting for the lock to become available.
> 
> Can I find out which process owns a lock?
> Is there any way to unlock the file (if I could find out which one it is)
>  without reboot?
> Over NFS, can I trick the lockd's into loosing locks?


Assuming you have the source and if the lock is a semaphore, you can set
the SEM_UNDO flag when the lock is aquired so that when a process
terminates the lock is guaranteed to be dropped:

        partdb->sops.sem_num = 0;
        partdb->sops.sem_op  = -1;
        partdb->sops.sem_flg = SEM_UNDO;
        if (semop(partdb->sem_id, &partdb->sops, 1) == -1)
                perror("semop (lock)");

If you have no source, and again assuming semaphores, use ipcs(1) to get
the current semaphores and then use ipcrm(1) to remove it.

Tony V.
Kernel Group



      reply	other threads:[~2000-10-24  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-24  4:00 How to identify locking process Stefan Schwarzer
2000-10-24  4:00 ` Tony Verhulst [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox