Reputation: 75
I am trying to figure out if a gameserver is running. I found a lot of dirty methods so I wanted to make it basically easy by calling a PHP script which checks if a process is running. Well what I was trying was:
<?php
exec("bin_unix/linux_server", $output, $return);
if ($return == 0) {
echo "Ok, process is running\n";
} else {
echo "Process is not running\n";
}
but its not working (since I am sure the process is running).. its not a "real" process don't blame me I am not an linux expert.
So what I do to run this server is the following command:
cd /path/to/server/ && nohup bin_unix/linux_server &
I guess the bin_unix/linux_server
in the exec();
is wrong, but its the only static information I get with ps aux
.
The process_id will change often so I am not sure what to type there..
Upvotes: 2
Views: 1816