Comment 5 for bug 888770

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

runlock is insufficient, because it only takes into account the process name, and not the arguments.

For instance, try this in terminal 1:
 $ runlock sleep 100

And in terminal 2:
 $ runlock sleep 200

Your second terminal's runlock will terminate with an error condition because the "sleep" process is running (nevermind that you're running a different screen). Imagine something like "rsync", where you might have several different backup jobs that use rsync, each with their own arguments.

Instead, try this with run-one, terminal 1:
 $ run-one sleep 100

And terminal 2:
 $ run-one sleep 200

Both of these are allowed to run, because they're unique commands with different arguments.

Open a third terminal and try to 'run-one sleep 100', and you'll see that it terminates, because one of those specifically is already running.

I don't see anything like 'run-this-one' in cronutils. Again, in terminal 3 try 'run-this-one sleep 200'. It should kill the other one, and run THIS one.

And keep-one-running is different from nohup (in case you're wondering), because keep-one-running will restart the command (and parameters) again, in ANY case of exit (zero, non-zero, as well as interrupt signals). nohup just ignores signals.