use the same cron.d-name as in the config-template as the 'default' cronjob is not needed after the first generation of the new one; generate different lockfiles for the different jobs to avoid unnecessary conflicts
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -31,8 +31,19 @@ if (function_exists("date_default_timezone_set")
|
||||
@date_default_timezone_set(@date_default_timezone_get());
|
||||
}
|
||||
|
||||
$basename = basename($_SERVER['PHP_SELF'], '.php');
|
||||
if (isset($argv) && is_array($argv) && count($argv) > 1) {
|
||||
for($x=1;$x < count($argv);$x++) {
|
||||
if (substr(strtolower($argv[$x]), 0, 2) == '--'
|
||||
&& strlen($argv[$x]) > 3
|
||||
) {
|
||||
$basename .= "-".substr(strtolower($argv[$x]), 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$lockdir = '/var/run/';
|
||||
$lockFilename = 'froxlor_' . basename($_SERVER['PHP_SELF'], '.php') . '.lock-';
|
||||
$lockFilename = 'froxlor_' . $basename . '.lock-';
|
||||
$lockfName = $lockFilename . getmypid();
|
||||
$lockfile = $lockdir . $lockfName;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user