Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISPConfig
ISPConfig 3
Commits
3d46303e
Commit
3d46303e
authored
Mar 01, 2009
by
tbrehm
Browse files
Enabled locking mechanism for server script.
parent
797afa4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/server.php
View file @
3d46303e
...
...
@@ -49,13 +49,14 @@ if($server_db_record == false) {
}
*/
/*
// Check if another process is running
if
(
is_file
(
$conf
[
"temppath"
]
.
$conf
[
"fs_div"
]
.
".ispconfig_lock"
)){
clearstatcache
();
for($i=0;$i<120;$i++){ // Wait max. 120 sec, then proceed
for
(
$i
=
0
;
$i
<
120
;
$i
++
){
// Wait max. 120
0
sec, then proceed
if
(
is_file
(
$conf
[
"temppath"
]
.
$conf
[
"fs_div"
]
.
".ispconfig_lock"
)){
sleep(1);
$app
->
log
(
"There is already a lockfile set. Waiting another 10 seconds..."
,
LOGLEVEL_DEBUG
);
sleep
(
10
);
clearstatcache
();
}
}
...
...
@@ -64,7 +65,7 @@ if(is_file($conf["temppath"].$conf["fs_div"].".ispconfig_lock")){
// Set Lockfile
@
touch
(
$conf
[
"temppath"
]
.
$conf
[
"fs_div"
]
.
".ispconfig_lock"
);
$app
->
log
(
"Set Lock: "
.
$conf
[
"temppath"
]
.
$conf
[
"fs_div"
]
.
".ispconfig_lock"
,
LOGLEVEL_DEBUG
);
*/
if
(
$app
->
dbmaster
->
connect
())
{
...
...
@@ -116,11 +117,11 @@ if($app->dbmaster->connect()) {
$app
->
log
(
"Unable to connect to master server."
,
LOGLEVEL_ERROR
);
}
/*
// Remove lock
@
unlink
(
$conf
[
"temppath"
]
.
$conf
[
"fs_div"
]
.
".ispconfig_lock"
);
$app
->
log
(
"Remove Lock: "
.
$conf
[
"temppath"
]
.
$conf
[
"fs_div"
]
.
".ispconfig_lock"
,
LOGLEVEL_DEBUG
);
*/
die
(
"finished.
\n
"
);
?>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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