Commit 9b82d291 authored by jwarnier's avatar jwarnier
Browse files

Slightly improve process matching with a well-known UNIX shell trick.

parent 10df6dc6
......@@ -67,12 +67,12 @@ if($app->dbmaster->connect()) {
// Check if another process is running
// Check whether another instance of this script is already running
for($i=0;$i<120;$i++){ // Wait max. 1200 sec, then proceed
for($i=0;$i<120;$i++){ // Wait max. 1200 sec, then retry
exec("ps aux | grep '/usr/local/ispconfig/server/server.php' | grep -v 'grep' | wc -l", $check);
exec("ps aux | grep '/usr/local/ispconfig/server/[s]erver.php' | wc -l", $check);
if(intval($check[0]) > 1) { // 1 because this is 2nd instance!
$app->log("There is already an instance of server.php running. Exiting.", LOGLEVEL_DEBUG);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment