fix: Correct systemd configuration and Debian package setup

- Fix database update service to include config path parameter
- Move ConditionACPower from [Timer] to [Unit] section in timer config
- Add database directory to ReadWritePaths in main service
- Set explicit database path in Debian package config template
- Simplify postinst script to be quiet and use consistent skyview-adsb user
- Update README.Debian with comprehensive systemd service documentation
- Remove confusing dual-user setup in favor of single skyview-adsb user

SystemD Configuration Summary:
- Main service: skyview-adsb.service with database pre-update
- Database service: skyview-database-update.service (oneshot)
- Weekly timer: skyview-database-update.timer (Sunday 3AM with randomization)
- All services use skyview-adsb user consistently
- Database path: /var/lib/skyview-adsb/skyview.db
- Config path: /etc/skyview-adsb/config.json

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2025-08-31 19:59:29 +02:00
commit 779384b748
6 changed files with 169 additions and 123 deletions

View file

@ -39,8 +39,8 @@ RestrictNamespaces=true
# Allow network access
PrivateNetwork=false
# Allow writing to log directory
ReadWritePaths=/var/log/skyview-adsb
# Allow writing to log and database directories
ReadWritePaths=/var/log/skyview-adsb /var/lib/skyview-adsb
# Capabilities
CapabilityBoundingSet=CAP_NET_BIND_SERVICE

View file

@ -8,7 +8,7 @@ Wants=network-online.target
Type=oneshot
User=skyview-adsb
Group=skyview-adsb
ExecStart=/usr/bin/skyview-data update
ExecStart=/usr/bin/skyview-data -config /etc/skyview-adsb/config.json update
StandardOutput=journal
StandardError=journal

View file

@ -2,6 +2,8 @@
Description=SkyView Database Update Timer
Documentation=man:skyview-data(1)
Requires=skyview-database-update.service
# Don't start if system is on battery (laptops)
ConditionACPower=true
[Timer]
# Run weekly on Sunday at 3 AM
@ -10,8 +12,6 @@ OnCalendar=Sun 03:00
RandomizedDelaySec=3600
# Start immediately if system was down during scheduled time
Persistent=true
# Don't start if system is on battery (laptops)
ConditionACPower=true
[Install]
WantedBy=timers.target