systemd Type=notify for zero-downtime binary upgrade
systemctl reload pg_doorman now works correctly with client migration. systemd tracks the new process after upgrade — no duplicate instances, no restart loops.
pg_doorman sends sd_notify(READY=1) on startup and sd_notify(MAINPID=<child_pid>) during SIGUSR2 upgrade. systemd transfers PID tracking to the new process before the old one exits.
Recommended service file:
[Service]
Type=notify
NotifyAccess=exec
ExecStart=/usr/bin/pg_doorman /etc/pg_doorman/pg_doorman.toml
ExecReload=/bin/kill -SIGUSR2 $MAINPID
KillMode=mixed
Restart=on-failurePrevious Type=forking + --daemon units continue to work but do not benefit from client migration.
Docker STOPSIGNAL changed from SIGINT to SIGTERM to prevent binary upgrade in containers.
Full changelog: https://ozontech.github.io/pg_doorman/changelog.html
systemd Type=notify для zero-downtime binary upgrade
systemctl reload pg_doorman теперь корректно работает с миграцией клиентов. systemd отслеживает новый процесс после upgrade — без дублей, без restart loops.
pg_doorman отправляет sd_notify(READY=1) при старте и sd_notify(MAINPID=<child_pid>) при SIGUSR2 upgrade. systemd переключает PID tracking на новый процесс до завершения старого.
Рекомендуемый service file:
[Service]
Type=notify
NotifyAccess=exec
ExecStart=/usr/bin/pg_doorman /etc/pg_doorman/pg_doorman.toml
ExecReload=/bin/kill -SIGUSR2 $MAINPID
KillMode=mixed
Restart=on-failureСтарые Type=forking + --daemon unit'ы продолжают работать, но без миграции клиентов.
Docker STOPSIGNAL изменён с SIGINT на SIGTERM.
Полный changelog: https://ozontech.github.io/pg_doorman/changelog.html