[pacman-dev] Improving locking - Was: [PATCH] Use file locks (flock) to stop multiple pacman instances from running concurrently. This improves the current model by automatically removing locks held by programs has failed to remove the lock, for example at a crash, forced kill or power outage.

Jan Alexander Steffens jan.steffens at gmail.com
Sun Aug 18 23:44:29 EDT 2013

On Mon, Aug 19, 2013 at 5:39 AM, Allan McRae <allan at archlinux.org> wrote:
> I stored the process ID in the lock file during creation many years ago.
>  Is there a portable way for us to determine if that process ID is still
> running and remove the lock file automatically if it is not?

Try to kill the PID with signal 0 and remove it if it fails with ESRCH?

More information about the pacman-dev mailing list