NAME

lcfglock - lock/unlock component semaphore

VERSION

This documentation refers to lcfglock version 1.20.10

USAGE

lcfglock [options] component

DESCRIPTION

This command is used by LCFG components to prevent multiple simultaneous executions of component methods.

OPTIONS

-b|--break

When used in conjunction with -u|--unlock this option forces the lock on the named component to be broken, even if it was owned by some other process.

-d|--dir dir

Use directory dir for lock files.

-D|--debug

Print debugging messages to stderr.

-n|--noblock

Lock operations return immediately with exit status 2 if the semaphore is busy rather than waiting. Note that the default behaviour is to wait forever.

-p|--pid pid

Use pid as the process owning the semaphore. The default is is the process calling lcfglock.

-m|--message msg

A message which should be inserted into the lock file when the lock is acquired. This is used by ngeneric to record the name of the component method being called.

-q|--quiet

Quiet mode. exit silently when attempting to release non-existent locks, or to take already existing locks.

-t|--timeout secs

Lock operations return immediately with exit status 2 if the semaphore is busy after waiting secs seconds. Note that the default behaviour is to wait forever.

-u|--unlock

Unlock (rather than lock) the semaphore.

-v|--verbose

Print messages when waiting for lock.

-h|--help

This option causes the usage documentation to be printed to the screen.

EXIT STATUS

If there is a usage error this script will exit with a status of 254. If the lock or unlock command completes successfully the exit status will be zero. If there is an existing lock and no-blocking is requested or the timeout is exceeded the exit status will be 2. All other errors will result in an exit status of 1.

PLATFORMS

This is the list of platforms on which we have tested this software. We expect this software to work on any Unix-like platform which is supported by Perl.

UbuntuFocal, EnterpriseLinux7

BUGS AND LIMITATIONS

Please report any bugs or problems (or praise!) to bugs@lcfg.org, feedback and patches are also always very welcome.

AUTHOR

Stephen Quinney <squinney@inf.ed.ac.uk>, Paul Anderson <dcspaul@inf.ed.ac.uk>

LICENSE AND COPYRIGHT

Copyright (C) 2001-2019 University of Edinburgh. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GPL, version 2 or later.