fix(varaverk): remove legacy /etc/cron.d/varaverk on cron rebuild
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.
This commit is contained in:
@@ -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.
|
// 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;
|
if (file_put_contents(CRON_FILE, implode("\n", $lines)) === false) return false;
|
||||||
exec('/usr/local/sbin/update_cron');
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user