Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
lolo888
ISPConfig 3
Commits
9b82d291
Commit
9b82d291
authored
Aug 17, 2010
by
jwarnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slightly improve process matching with a well-known UNIX shell trick.
parent
10df6dc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
server/server.php
server/server.php
+3
-3
No files found.
server/server.php
View file @
9b82d291
...
...
@@ -67,12 +67,12 @@ if($app->dbmaster->connect()) {
}
// Check
if
another
process is
running
// Check
whether
another
instance of this script is already
running
if
(
is_file
(
$conf
[
"temppath"
]
.
$conf
[
"fs_div"
]
.
".ispconfig_lock"
)){
clearstatcache
();
for
(
$i
=
0
;
$i
<
120
;
$i
++
){
// Wait max. 1200 sec, then
proceed
for
(
$i
=
0
;
$i
<
120
;
$i
++
){
// Wait max. 1200 sec, then
retry
if
(
is_file
(
$conf
[
"temppath"
]
.
$conf
[
"fs_div"
]
.
".ispconfig_lock"
)){
exec
(
"ps aux | grep '/usr/local/ispconfig/server/
s
erver.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
);
exit
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment