EnglishFrenchSpanish

OnWorks favicon

dotlockfile - Online in the Cloud

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

This is the command dotlockfile 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


dotlockfile - Utility to manage lockfiles

SYNOPSIS


/usr/bin/dotlockfile [-l [-r retries] |-u|-t|-c] [-p] [-m|lockfile]

DESCRIPTION


dotlockfile is a command line utility to reliably create, test and remove lockfiles. It
creates lockfiles reliably on local and NFS filesystems, because the crucial steps of
testing for a preexisting lockfile and creating it are performed atomically by a single
call to link(2). Manpage lockfile_create(3) describes the used algorithm.

dotlockfile is installed with attribute SETGID mail and thus can also be used to lock and
unlock mailboxes even if the mailspool directory is only writable by group mail.

The name dotlockfile comes from the way mailboxes are locked for updates on a lot of UNIX
systems. A lockfile is created with the same filename as the mailbox but with the string
".lock" appended.

The names dotlock and lockfile were already taken - hence the name dotlockfile :).

OPTIONS


-l Create a lockfile if no preexisting valid lockfile is found, else wait and retry
according to option -r. This option is the default.

A lockfile is treated as valid,
· if it holds the process-id of a running process,
· or if it does not hold any process-id and has been touched less than 5 minutes
ago (timestamp is younger than 5 minutes).

-r retries
The number of times dotlockfile retries to acquire the lock if it failed the first
time before giving up. The initial sleep after failing to acquire the lock is
5 seconds. After each retry the sleep intervall is increased incrementally by
5 seconds up to a maximum sleep of 60 seconds between tries. The default number of
retries is 5. To try only once, use "-r 0". To try indefinitely, use "-r -1".

-u Remove a lockfile.

-t Touch an existing lockfile (update the timestamp). Useful for lockfiles on NFS
filesystems. For lockfiles on local filesystems the -p option is preferable.

-c For debugging only: Check for the existence of a valid lockfile.

Note: Testing for a preexisting lockfile and writing of the lockfile must be done
by the same "dotlockfile -l" or "dotlockfile -m" command, else the lockfile
creation cannot be reliable.

-p Write the process-id of the calling process into the lockfile. Also when testing
for an existing lockfile, check the contents for the process-id of a running
process to verify if the lockfile is still valid. Obviously useful only for
lockfiles on local filesystems.

-m Lock or unlock the current users mailbox. The path to the mailbox is the default
system mailspool directory (usually /var/mail) with the username as gotten from
getpwuid() appended. If the environment variable $MAIL is set, that is used
instead. Then the string ".lock" is appended to get the name of the actual
lockfile.

lockfile
The lockfile to be created or removed. Must not be specified, if the -m option is
in effect.

RETURN VALUE


Zero on success, and non-zero on failure. For the -c option, sucess means that a valid
lockfile is already present. When locking (the default, or with the -l option)
dotlockfile returns the same values as the library function lockfile_create(3). Unlocking
a non-existant lockfile is not an error.

NOTES


The lockfile is created exactly as named on the command line. The extension ".lock" is
not automatically appended.

This utility is a lot like the lockfile(1) utility included with procmail, and the
mutt_dotlock(1) utility included with mutt. However the command-line arguments differ,
and so does the return status. It is believed, that dotlockfile is the most flexible
implementation, since it automatically detects when it needs to use priviliges to lock a
mailbox, and does it safely.

The above mentioned lockfile_create(3) manpage is present in the liblockfile-dev package.

Use dotlockfile online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Alt-F
    Alt-F
    Alt-F provides a free and open source
    alternative firmware for the DLINK
    DNS-320/320L/321/323/325/327L and
    DNR-322L. Alt-F has Samba and NFS;
    supports ext2/3/4...
    Download Alt-F
  • 2
    usm
    usm
    Usm is a unified slackware package
    manager that handles automatic
    dependency resolution. It unifies
    various package repositories including
    slackware, slacky, p...
    Download usm
  • 3
    Chart.js
    Chart.js
    Chart.js is a Javascript library that
    allows designers and developers to draw
    all kinds of charts using the HTML5
    canvas element. Chart js offers a great
    array ...
    Download Chart.js
  • 4
    iReport-Designer for JasperReports
    iReport-Designer for JasperReports
    NOTE: iReport/Jaspersoft Studio Support
    Announcement: As of version 5.5.0,
    Jaspersoft Studio will be the official
    design client for JasperReports. iReport
    will...
    Download iReport-Designer for JasperReports
  • 5
    PostInstallerF
    PostInstallerF
    PostInstallerF will install all the
    software that Fedora Linux and others
    doesn't include by default, after
    running Fedora for the first time. Its
    easy for...
    Download PostInstallerF
  • 6
    strace
    strace
    The strace project has been moved to
    https://strace.io. strace is a
    diagnostic, debugging and instructional
    userspace tracer for Linux. It is used
    to monitor a...
    Download strace
  • More »

Linux commands

Ad