Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to run a script with nohup via rcmd ??

0 views
Skip to first unread message

rie...@4com.de

unread,
Feb 9, 2000, 3:00:00 AM2/9/00
to
Hi,
I want to run a script on another host via rcmd, so i do a

rcmd host scriptname

but the rcmd never returns.

in the script, i start a process with nohup. (without this, everything
works fine!!)

When i interrupt the rcmd with ctrl-break, i get the output from the
process on my screen.

What did i wrong ???

Any hints ??

Thanks,

Jonas


Ken Pizzini

unread,
Feb 15, 2000, 3:00:00 AM2/15/00
to
On Wed, 09 Feb 2000 14:57:16 GMT, rie...@4com.de <rie...@4com.de> wrote:
>I want to run a script on another host via rcmd, so i do a
>
>rcmd host scriptname
>
>but the rcmd never returns.

The rcmd process waits for the remote end to close the stdin and
stdout descriptors that the rcmd set up for it.

>in the script, i start a process with nohup. (without this, everything
>works fine!!)
>
>When i interrupt the rcmd with ctrl-break, i get the output from the
>process on my screen.
>
>What did i wrong ???

You didn't redirect the output on the remote system. Try adding
to the top of your script (just after the #! line):
exec </dev/null > $HOME/script.log 2>&1

--Ken Pizzini

Cyrille Lefevre

unread,
Feb 19, 2000, 3:00:00 AM2/19/00
to
k...@halcyon.com (Ken Pizzini) writes:

or do somethig like that :

rcmd host scriptname \< /dev/null \> /dev/null 2\>\&1 &
or
rcmd host "scriptname </dev/null > /dev/null 2>&1 &"

like this the job will run by its own on the otherside host
if you want to keep the rcmd connection open on your side
just do :

rcmd host -n scriptname &

did you read the manual of rcmd ? it's explained inside.

Cyrille.
--
mailto:clef...@no-spam.citeweb.net Remove "no-spam." to answer me back.
mailto:Cyrille...@no-spam.edf.fr Supprimer "no-spam." pour me repondre.

0 new messages