From ec53524155522b272812e3532d69071ac06da7d7 Mon Sep 17 00:00:00 2001 From: xmacan Date: Fri, 18 Aug 2023 12:01:49 +0200 Subject: [PATCH 1/2] add process registration --- cli/poller_reindex_hosts.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cli/poller_reindex_hosts.php b/cli/poller_reindex_hosts.php index 6f5f5aeca4..1ca4aee901 100755 --- a/cli/poller_reindex_hosts.php +++ b/cli/poller_reindex_hosts.php @@ -152,6 +152,17 @@ print 'WARNING: Do not interrupt this script. Reindexing can take quite some time' . PHP_EOL; debug("There are '" . cacti_sizeof($data_queries) . "' data queries to run"); + +/* silently end if the registered process is still running */ +if (!$force) { + if (!register_process_start('reindex', 'master', 0, 86400)) { + print "FATAL: Detected an already running process. Use --force to override" . PHP_EOL; + exit(0); + } +} + + + $i = 1; $total_start = microtime(true); if (cacti_sizeof($data_queries)) { @@ -195,6 +206,9 @@ $i++; } + + unregister_process('reindex', 'master'); + } function display_version() { From d5eb62c6d8f4bf4ed4dcc8f402de2e10bb0c092f Mon Sep 17 00:00:00 2001 From: xmacan Date: Fri, 18 Aug 2023 12:04:26 +0200 Subject: [PATCH 2/2] update --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index abd102e711..3975d6f7f5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -69,6 +69,7 @@ Cacti CHANGELOG -issue#5450: Unable to bulk convert to latin1 if desired -issue#5451: Reported on the Forums, Graph creation slows over time -issue#5452: The default 'bulk_walk_size' is -1 which means a device will never find it's optimal bulk walk size +-issue#5457: Enable 'Re-Index All Device Schedule' causes a lot of reindex processes -feature#5375: Add template for Fortinet firewall and Aruba Instant cluster -feature#5393: Add template for SNMP printer -feature#5418: Display device class before package import