fix: self-healing permissions on /var/lib/syncserver

- systemd: add ExecStartPre to chown -R the data dir before every start
- postinst: add chown -R after creating dirs to fix ownership on upgrades

This prevents the service from failing if dirs were created by root or
drifted ownership after a manual run.
This commit is contained in:
2026-07-07 15:41:10 -04:00
parent 9038e3a000
commit 4cc93c7747
3 changed files with 3 additions and 0 deletions
@@ -8,6 +8,7 @@ Wants=network-online.target
Type=simple
User=syncserver
Group=syncserver
ExecStartPre=/bin/chown -R syncserver:syncserver /var/lib/syncserver
ExecStart=/usr/bin/syncserver --config /etc/syncserver/config.yaml --data-dir /var/lib/syncserver
Restart=on-failure
RestartSec=5