[jump to content][No Software Patents]Tools (new) : lockrun [ Home | Scylla+Charybdis old home | Tools (old) | Tools (new) | FAQ | Downloads ]

Moving to GitHub, slowly

The software on this pages will slowly be moved to GitHub https://github.com/hilbix/. The CVS repository will be migrated to GIT as well, so the history will be preserved, a bit. See FAQ.

Scylla and Charybdis, lockrun - Tools

The tools are developed under Linux with ESR's paradigm release early, release often in mind.
So you can consider this beta software, or alpha, or pre-alpha, or even worse ;)

Have a look in the download directory for all downloads.
As always here, all you get is the source. No binaries here.

lockrun 0.6.2-20110613-163042

Exclusively run something by placing a file lock


⇒ ⇒ ⇒ The development shifted to another location. All future versions will be published at https://github.com/hilbix/lockrun   ⇐ ⇐ ⇐


There is a similar Debian package "lckdo" which has some different features.

Lockrun opens or creates a file, places a lock on the file, and if obtained, runs some other program. If the program terminates, the lock is removed.

If there already is a lock on the file, it waits for the lock to be aquired. With option -n it does not wait for the lock and instead returns false or true in case option -i is used.

With option -u a lockfile can be created which is safely removed after it is no more needed (this option is experimental). To safely remove such a locked file after crashes you can use 'lockrun -vvu "file" true'.

History:

version 0.6.2-20110613-163042

download (259352 bytes) sig

Option -q now disables timeout message if lock cannot be aquired.

version 0.6.1-20110420-162055

download (259361 bytes) sig

Option -m added. Option -v can be given twice. Minor cosmetic changes like usage pattern corrected for "Invoke shell script only once".

Note that you would want to lock for the shell script's name (like presented in the usage) and not for some MAGIC. Also note that locking a shell script often does not work, as some shells do not like to run locked files.

Option -v now can be more verbose (only in combination with option -u). Option -m changes the return code in case the error comes from lockrun and not the forked child.

version 0.6.0-20100528-142622

download (253940 bytes) sig

Option -i makes lockrun return success even if the lock could not aquired and the cmd was not run.

Use this if you desparately need the return value of your cmd and not being able to aquire a lock is no failure (i. e. because something else is processing). Please note lockrun still returns a non-success value for other type of errors (like disk write error).

For example "lockrun -ni .lock false" now returns 0 (success) if lock cannot be aquired and 1 (false) if the file was lockable. So it now is (vastly) the opposite of "lockrun -n .lock true". Both will fail if, for example, the current directory is not writeable. (Note that the lock is only held while the command runs.)

version 0.5.0-20090727-020420

download (239849 bytes) sig

Option -f added

If this option is present, this makes lockrun fail if the given file to lock is missing.

version 0.4.0-20090227-125233

download (230712 bytes) sig

Option -c, -d and -l added.

With option -l you can redirect logging to some other fd, like in "lockrun -vl42 cmd 42>file".

With options -c and -d you can display a "waiting string" to stdout. If you need it to stderr, try -l2.

[view more history][view complete history]

License and Disclaimer

All you can see here is free software according to the GNU GPL.
Copyright (C)2000-2011 by Valentin Hilbig
Note that the software comes with absolutely no warranty of any kind.
You use the software at your own risk.
Valentin Hilbig cannot be hold responsible for any unintended damage,
lost data or malfunction of the software you can find here.

[FSFE contributor 2007]

[end of page - jump back to content][hacker culture]
Last modified: 2011-09-12 by Valentin Hilbig [ Imprint / Impressum ]