feature: Add a new locking framework that uses flock. (#6858)

Change locks to use flock, as pid checking is not
sufficient when PID Namespaces are involved.
This commit is contained in:
keeperofdakeys
2017-07-03 14:14:36 +09:30
committed by Tony Murray
parent f02b551145
commit 701fbbc29b
3 changed files with 102 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ require __DIR__ . '/includes/init.php';
$options = getopt('d::');
set_lock('alerts');
$alerts_lock = \LibreNMS\FileLock::lockOrDie('alerts');
if (isset($options['d'])) {
echo "DEBUG!\n";
@@ -60,4 +60,4 @@ if (!defined('TEST') && $config['alert']['disable'] != 'true') {
echo 'End : '.date('r')."\r\n";
}
release_lock('alerts');
$alerts_lock->release();