Execute remote commands in the background

Create issue
Issue #769 new
Erik Schnetter created an issue

In response to a discussion on the mailing list, I replied:

What we need here is an unsafe delayed-execution mechanism. So far, Simfactory provides the safe version of these mechanisms -- it is safe because all files are copied into the simulation directory, so that the resulting simulation is self-contained. Since this takes time, we are now looking for an unsafe mechanism that works much faster, but could fail. (For example, if one modified the source tree while Simfactory is still copying test results, the resulting simulation may be inconsistent.)

I believe the standard Unix mechanism is "nohup". For example, after logging in, you would say "nohup sim create-submit mytests --testsuite --procs 2 &" (note the ampersand to make it run in the background). What we now want is the same thing, except without logging in manually.

A current work-around may be something like:

./bin/sim --remote ranger execute 'nohup sleep 100 </dev/null

/dev/null 2>&1 & :'

This executes a certain command on Ranger without waiting for the result. It is necessary to redirect I/O so that ssh finishes. The final ":" is a null command to obtain a legal shell syntax -- Simfactory expects the command to end without a terminator (such as "&" or ";").

If you replace the "sleep 100" with any other command (e.g. "sim submit"), things may work.

In the long term, this should become an option to "--remote", e.g. "--remote-background". There should then also be a way to retrieve the output generated by this command (which necessarily remains on the remote system).

Keyword:

Comments (0)

  1. Log in to comment