ssh+background process in script
hari krishna angadi
reachtohari at yahoo.com
Wed Nov 19 06:18:52 UTC 2008
Hi,
I am porting some test codes from Fedora core 2 to Fedora core 8.it
works fine in FC2(2.6.5-1.358) but problem in FC8(2.6.23.1-42.fc8).
Pgm.c
---------
#include<stdio.h>
int main void(int)
{
fprintf(stderr,"hello world\n",);
}
$ gcc -o Pgm Pgm.c
$ vim myscript.sh
./Pgm &
$ /usr/bin/ssh -x -n -o BatchMode=yes 127.0.0.1 cd /home/tom/Test_Dir/ '&&' ./myscript.sh
If i run this command hello world is not printed.
If i run this same in FC2 hello world in printed.
Whether there is solution to this or it is a bug of FC8?
--------------------------------------------------------------------------------------------------
Below solutions are correct?.
--------------------------------------------------------------------------------------------
Solution 1:
----------
If i do these changes i.e if i re-direct to stdout and run in background.
$ vim myscript.sh
./Pgm 2>&1 &
$ /usr/bin/ssh -x -n -o BatchMode=yes 127.0.0.1 cd /home/tom/Test_Dir/ '&&' ./myscript.sh
If i run this command it works fine.
Solution 2:
----------
vim myscript.sh
./Pgm </dev/null >&/dev/null &
$ /usr/bin/ssh -x -n -o BatchMode=yes 127.0.0.1 cd /home/tom/Test_Dir/ '&&' ./myscript.sh
Regards,
Hari Krishna
Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com.
http://mail.promotions.yahoo.com/newdomains/aa/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20081118/01d41ef4/attachment-0001.htm>
More information about the fedora-list
mailing list