It just checks for a pid file. If the pid file does not exist, or the pid no longer exists, it'll start the process (program), and write the new process' pid to the pid file.
It's at:
https://stromberg.dnsalias.org/svn/just-one/trunk/
...and usage looks like:
$ ./just-one -h below cmd output started 2021 Sun Apr 18 04:44:03 PM PDT Usage: ./just-one --command command --string string
The "string" part needs to be a unique identifier for each process you want only one of. The command, naturally, is a shell command.
It does not use locking: advisory or mandatory. Just a lock file containing a pid.
EG:
$ ./just-one --string 'unique ls' --command ls below cmd output started 2021 Sun Apr 18 04:53:18 PM PDT about to mkdir about to get pid about to start command Makefile just-one test-just-one this-pylint
You can e-mail the author with questions or comments: