From 5e7b84e620d7b6bfd5edd7f205ad029ea89f13f7 Mon Sep 17 00:00:00 2001 From: Andreas Bachlechner <62039342+bachandi@users.noreply.github.com> Date: Tue, 5 Jul 2022 21:47:28 +0200 Subject: [PATCH] Add INHIBIT_LOCKING environment variable to disable rrd locking during the cgi call on a per call basis. --- man/man5/monitorix.conf.5 | 2 +- monitorix.cgi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/man5/monitorix.conf.5 b/man/man5/monitorix.conf.5 index 78eacc0..7ac8134 100644 --- a/man/man5/monitorix.conf.5 +++ b/man/man5/monitorix.conf.5 @@ -171,7 +171,7 @@ Default value: \fIy\fP .P .BI enable_rrd_lock .RS -This option will synchronise the rrd file access by creating the file \fI/tmp/monitorix.lock\fP and use it via flock. +This option will synchronise the rrd file access by creating the file \fI/tmp/monitorix.lock\fP and use it via flock. The read lock during the cgi call can be disabled on a per call basis via setting the environment variable \fIINHIBIT_LOCKING\fP. This is useful for modules that call the cgi function internally. .P Default value: \fIn\fP .RE diff --git a/monitorix.cgi b/monitorix.cgi index 23d9dd3..bbc4d39 100755 --- a/monitorix.cgi +++ b/monitorix.cgi @@ -580,7 +580,7 @@ if($mode eq "localhost") { my @writers; # array of file descriptors my $children = 0; - my $lockfile_handler = lockfile_handler(\%config); + my $lockfile_handler = lockfile_handler(\%config) unless $ENV{INHIBIT_LOCKING}; global_flock($lockfile_handler, LOCK_SH); foreach (split(',', $config{graph_name})) { my $gn = trim($_);