EnglishFrenchSpanish

OnWorks favicon

shlock - Online in the Cloud

Run shlock in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command shlock that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


shlock - create lock files for use in shell scripts

SYNOPSIS


shlock -p pid -f name [ -b ] [ -u ] [ -c ]

DESCRIPTION


Shlock tries to create a lock file named name and write the process ID pid into it. If
the file already exists, shlock will read the process ID from the file and test to see if
the process is currently running. If the process exists, then the file will not be
created.

Shlock exits with a zero status if it was able to create the lock file, or non-zero if the
file refers to currently-active process.

OPTIONS


-b Process IDs are normally read and written in ASCII. If the ``-b'' flag is used,
then they will be written as a binary int. For compatibility with other systems,
the ``-u'' flag is accepted as a synonym for ``-b'' since binary locks are used by
many UUCP packages.

-c If the ``-c'' flag is used, then shlock will not create a lock file, but will
instead use the file to see if the lock is held by another program. If the lock is
valid, the program will exit with a non-zero status; if the lock is not valid
(i.e., invoking shlock without the flag would have succeeded), then the program
will exit with a zero status.

EXAMPLES


The following example shows how shlock would be used within a shell script:
LOCK=/run/innd/LOCK.send
trap 'rm -f ${LOCK} ; exit 1' 1 2 3 15
if shlock -p $$ -f ${LOCK} ; then
# Do appropriate work
else
echo Locked by `cat ${LOCK}`
fi

HISTORY


Written by Rich $alz <[email protected]> after a description of HDB UUCP locking given by
Peter Honeyman. This is revision 1.9, dated 1996/10/29.

SHLOCK(1)

Use shlock online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    archlabs_repo
    archlabs_repo
    Package repo for ArchLabs This is an
    application that can also be fetched
    from
    https://sourceforge.net/projects/archlabs-repo/.
    It has been hosted in OnWorks in...
    Download archlabs_repo
  • 2
    Zephyr Project
    Zephyr Project
    The Zephyr Project is a new generation
    real-time operating system (RTOS) that
    supports multiple hardware
    architectures. It is based on a
    small-footprint kernel...
    Download Zephyr Project
  • 3
    SCons
    SCons
    SCons is a software construction tool
    that is a superior alternative to the
    classic "Make" build tool that
    we all know and love. SCons is
    implemented a...
    Download SCons
  • 4
    PSeInt
    PSeInt
    PSeInt is a pseudo-code interpreter for
    spanish-speaking programming students.
    Its main purpose is to be a tool for
    learning and understanding the basic
    concep...
    Download PSeInt
  • 5
    oStorybook
    oStorybook
    oStorybook l'outil privil�gi� des
    �crivains. ATTENTION : voir sur
    http://ostorybook.tuxfamily.org/v5/
    --en_EN oStorybook the right tool for
    writers. WARNIN...
    Download oStorybook
  • 6
    Asuswrt-Merlin
    Asuswrt-Merlin
    Asuswrt-Merlin is a third party
    firmware for select Asus wireless
    routers. Based on the Asuswrt firmware
    developed by Asus, it brings tweaks, new
    features and ...
    Download Asuswrt-Merlin
  • More »

Linux commands

  • 1
    aafigure
    aafigure
    aafigure - convert ASCII art to an
    image ...
    Run aafigure
  • 2
    aafire
    aafire
    aafire, aainfo, aasavefont, aatest -
    aalib example programs ...
    Run aafire
  • 3
    coqtop.opt
    coqtop.opt
    coqtop.opt - The native-code Coq
    toplevel ...
    Run coqtop.opt
  • 4
    coqwc
    coqwc
    coqwc - print the number of
    specification, proof and comment lines
    in Coq files ...
    Run coqwc
  • 5
    g15composer
    g15composer
    g15composer - Scriptable command
    interface to libg15render(3) drawing
    functions DESCRIPTION: G15composer is a
    scriptable command interface to the
    libg15render ...
    Run g15composer
  • 6
    g15daemon
    g15daemon
    g15daemon - provides access to extra
    keys and the LCD available on the
    logitech G15 keyboard. DESCRIPTION:
    G15Daemon allows users access to all
    extra keys by d...
    Run g15daemon
  • More »

Ad