mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-29 08:55:36 -04:00
Move orchestration (zmpkg.pl) and watchdog (zmwatch.pl) logic into zmdc.pl's ZMServer, eliminating two separate processes and the overhead of spawning full Perl processes for every watchdog restart. ZMServer now: - Orchestrates all daemon startup after socket setup (from zmpkg.pl) - Runs watchdog health checks inline every ZM_WATCH_CHECK_INTERVAL seconds, calling restart() directly instead of spawning zmdc.pl client processes (from zmwatch.pl) - Handles named state transitions via new 'state' socket command, updating DB and scheduling re-orchestration - Cleans shared memory on shutdown via zmMemTidy() zmpkg.pl is reduced to a thin shim that delegates to zmdc.pl for start/stop/restart/status/logrot and state commands, preserving backward compatibility with systemd, CLI, and web UI callers. zmwatch.pl.in is deleted; its logic is fully absorbed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>