>ssh to the remote machine.
>starts the process.
>use another ssh session to that machine to monitor if anyone is at the
>console.
>if so, send a Ctrl+c signal to the first terminal that starts the job,
>which will kill the job..

i suggest using SIGSTOP and SIGCONT for this purpose...SIGSTOP will
do what a ^z does if you don't type "bg" afterwards, while SIGCONT
will have the effect of 'fg' on the stopped job.  (those being
signals sendable with kill(1) or kill(2).)

i have some code which is fairly trivially modified to check console
status instead of load status, which runs in the background and does
checks every however long you set for a condition, and then stops
a program or restarts it depending on conditions.

i used it to run deschall (competitor to distributed.net back in the day)
and it worked perfectly for just the kind of situation you described.
and, my job was never killed and restarted, which was an issue since dumb
nfs file locking issues stood in the way of doing that cleanly.

ftp://ftp.distributed.net/pub/dcti/unsupported/lwatch.c

i would also use screen(1) to run the program under in case you want to
monitor it remotely and/or logout after starting it.  then you can
manually control it from anywhere yet not have to devote (and leave
running) an xterm/rxvt to do so.
screen is da bomb.
---------------------------------------------------------------------------
Send administrative requests to [EMAIL PROTECTED]

Reply via email to