Question:
PHP and MySQL Interpreting?
?
2010-07-04 20:56:21 UTC
What is this actually like trying to do? please be specific.. Like what its looking for in which folder etc etc. Thank you!


if($action == "restart"){
echo "Killing old process..
";
$done = 0;
while($done < 5){
$out = exec("killall -e java");
sleep(1);
$done ++;

}
echo "Launching new server...
";
chdir("/var/www/bin/");
exec("java -Xmx1200M server > /var/www/html/log.txt &");
echo "Done!
";
("cd /var/www/bin && java -Xmx800M server");
Three answers:
?
2010-07-04 21:01:11 UTC
It appears to be a snippet of code for restarting a server process. The server is written in java (as it kills and restarts the java process). The commands it calls through exec() are Unix-like, so this is for a Unix-like platform (Linux, UNIX, AIX, BSD, etc).
tony g
2010-07-05 04:02:51 UTC
$out = exec("killall -e java"); it is killing all instances of java processes running on the server



chdir("/var/www/bin/");

exec("java -Xmx1200M server > /var/www/html/log.txt &"); this starts /var/www/bin/server as a java process and appends its output to /var/www/html/log.txt
2010-07-05 04:01:15 UTC
First it kills the java process, then it runs a new one from /var/www/bin/


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...