From 253d5bf2e1ecb9da5771649c8b1bd3943fc8bd3b Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sun, 24 May 2026 21:27:38 -0400 Subject: [PATCH] fix(varaverk): remove legacy /etc/cron.d/varaverk on cron rebuild MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before update_cron was wired in, the plugin wrote directly to /etc/cron.d/varaverk. That file persisted after the migration and caused duplicate job firing (two watchdog instances at :00/:15/:30/:45). The second instance hit the lock, exited with warn, and overwrote the stat file — killing the running indicator while the first was still live. vv_cron_rebuild() now unlinks the legacy file after every update_cron call. Since rebuild_cron (boot event) calls vv_cron_rebuild(), the cleanup runs on every reboot and every schedule save. --- Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php b/Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php index a400fbb..9dceafa 100644 --- a/Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php +++ b/Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php @@ -67,6 +67,8 @@ function vv_cron_rebuild(array $schedule): bool { // Write to the plugin cron file; update_cron merges all plugin *.cron files into /etc/cron.d/root. if (file_put_contents(CRON_FILE, implode("\n", $lines)) === false) return false; exec('/usr/local/sbin/update_cron'); + // Remove legacy direct cron file left from before update_cron migration — prevents duplicate job firing. + @unlink('/etc/cron.d/varaverk'); return true; }