Skip to content

Commit 9b82d29

Browse files
author
jwarnier
committed
Slightly improve process matching with a well-known UNIX shell trick.
1 parent 10df6dc commit 9b82d29

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/server.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@
6767
}
6868

6969

70-
// Check if another process is running
70+
// Check whether another instance of this script is already running
7171
if(is_file($conf["temppath"].$conf["fs_div"].".ispconfig_lock")){
7272
clearstatcache();
73-
for($i=0;$i<120;$i++){ // Wait max. 1200 sec, then proceed
73+
for($i=0;$i<120;$i++){ // Wait max. 1200 sec, then retry
7474
if(is_file($conf["temppath"].$conf["fs_div"].".ispconfig_lock")){
75-
exec("ps aux | grep '/usr/local/ispconfig/server/server.php' | grep -v 'grep' | wc -l", $check);
75+
exec("ps aux | grep '/usr/local/ispconfig/server/[s]erver.php' | wc -l", $check);
7676
if(intval($check[0]) > 1) { // 1 because this is 2nd instance!
7777
$app->log("There is already an instance of server.php running. Exiting.", LOGLEVEL_DEBUG);
7878
exit;

0 commit comments

Comments
 (0)