Sep 24, 2000, 11:06 AM
Post #1 of 2
I have the following program that i have set up to run under cron - to keep the program alive.
i was trying to use the INC array to get the path correct.
i'm trying the cd as a dual command split by the ";" but i thought there was a way to set the path of the perl file so that all commands would be relative to that path.
$cmd="/bin/ps -elf | grep -v grep | grep $port | grep $proc_name";
open(CMD,"$cmd |") | | die "Can not issue acommand: $cmd:$!\n";
$_=~s/ / /g; # remove all extra spaces
($f,$e,$uid,$pid) = split(' ',$_);
$cmd = substr($x,64,400);
#print "uid=$uid pid=$pid cmd=$cmd\n";
#print "need to start process\n";
$cmd="cd /home/beaker/counter/;/usr/bin/java Server 6234 &";
open(CMD,"$cmd |") | | die "Can not issue restart command: $cmd:$!\n";
#print "process is going fine.\n";