#373 · Package upgrades start the enabled mail worker again (#371)
- timeline-app
- pull request
- packages
Fixes #371 An upgrade stops the server and the mail worker; `openchronology-migrate` started only the server, so an enabled mail worker stayed down and account email waited in `oc_mail_outbox`. **Debian and RPM** (`deploy/debian-server/openchronology-migrate`, which the RPM also ships): after restarting the server, `systemctl is-enabled --quiet openchronology-mail.service && systemctl restart openchronology-mail.service`, printing "OpenChronology mail worker restarted." A disabled worker stays stopped; `--no-restart` still restarts nothing. `postinst` and the RPM's `openchronology-setup` do the same where they restart the server. **FreeBSD**: the upgrade stops `openchronology_mail` too; `openchronology-migrate` now restarts it when it is enabled. **Homebrew**: upgrades don't stop the agent, but it keeps running the old version; `openchronology-migrate` restarts the mail agent when it is loaded. **Windows**: the installer already restarted an Automatic `OpenChronologyMail`; `openchronology-migrate.cmd` now does too (and still fails if the server's restart fails). **Compose**: `docs/docker.md` says to recreate `mail-worker` with the app. **Tests**: `test/server-mail-upgrade.mjs`, used by `server-deb.mjs` and `server-rpm.mjs`. The containers have no systemd, so a stand-in `systemctl` (with `/run/systemd/system`) keeps the units' enabled state and runs the mail worker as its unit would (with a placeholder Resend key; the outbox is empty). It checks that the upgrade stops the enabled worker, that `openchronology-migrate` starts it and it stays up, that `--no-restart` starts nothing, and that a disabled worker stays stopped. The FreeBSD, Homebrew and Windows tests check that their workers, which are not enabled, are not restarted. **Docs**: README.Debian, README.RPM, README.FreeBSD, README.Homebrew, README.Windows.txt, the deploy READMEs and an "Upgrading" note in `docs/administration.md`. Local: `node test/server-deb.mjs` (debian13) and `node test/server-rpm.mjs` (fedora44) pass on freshly built packages, and `npm test` passes (361/361).
Sources
Open #373 · Package upgrades start the enabled mail worker again (#371) in the timeline