ssh+background process in script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


New Email addresses available on Yahoo!
Get the Email name you've always wanted on the new @ymail and @rocketmail.
Hurry before someone else does!
-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux