diff options
Diffstat (limited to 'packaging')
| -rw-r--r-- | packaging/PKGBUILD | 8 | ||||
| -rw-r--r-- | packaging/dispatch-api.service | 20 | ||||
| -rw-r--r-- | packaging/dispatch.install | 4 |
3 files changed, 5 insertions, 27 deletions
diff --git a/packaging/PKGBUILD b/packaging/PKGBUILD index 57e7e28..de49d4e 100644 --- a/packaging/PKGBUILD +++ b/packaging/PKGBUILD @@ -91,10 +91,10 @@ package() { install -Dm644 dispatch.toml "${optdir}/dispatch.toml" fi - # --- systemd service --- + # --- systemd user service --- install -Dm644 \ "${srcdir}/dispatch-api.service" \ - "${pkgdir}/usr/lib/systemd/system/dispatch-api.service" + "${pkgdir}/usr/lib/systemd/user/dispatch-api.service" # --- Environment config (preserved across upgrades via backup=()) --- install -Dm644 \ @@ -119,10 +119,6 @@ package() { "${srcdir}/dispatch.svg" \ "${pkgdir}/usr/share/icons/hicolor/scalable/apps/dispatch.svg" - # --- sysusers: create the 'dispatch' system user --- - install -Dm644 /dev/null "${pkgdir}/usr/lib/sysusers.d/dispatch.conf" - echo 'u dispatch - "Dispatch API" /var/lib/dispatch' > "${pkgdir}/usr/lib/sysusers.d/dispatch.conf" - # --- License --- if [ -f "${_projectdir}/LICENSE" ]; then install -Dm644 "${_projectdir}/LICENSE" \ diff --git a/packaging/dispatch-api.service b/packaging/dispatch-api.service index ccbb727..120d460 100644 --- a/packaging/dispatch-api.service +++ b/packaging/dispatch-api.service @@ -1,12 +1,8 @@ [Unit] Description=Dispatch API Backend -After=network-online.target -Wants=network-online.target [Service] Type=simple -User=dispatch -Group=dispatch WorkingDirectory=/opt/dispatch ExecStart=/usr/bin/bun packages/api/src/index.ts EnvironmentFile=-/etc/dispatch/dispatch-api.conf @@ -15,19 +11,5 @@ RestartSec=5 StandardOutput=journal StandardError=journal -# Data directory: systemd creates /var/lib/dispatch owned by dispatch:dispatch -StateDirectory=dispatch - -# Tell the app to store its SQLite DB under /var/lib/dispatch/ -Environment=XDG_DATA_HOME=/var/lib - -# Security hardening -ProtectSystem=strict -ProtectHome=true -NoNewPrivileges=true -PrivateTmp=true -PrivateDevices=true -RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX - [Install] -WantedBy=multi-user.target +WantedBy=default.target diff --git a/packaging/dispatch.install b/packaging/dispatch.install index e6db694..7d1439f 100644 --- a/packaging/dispatch.install +++ b/packaging/dispatch.install @@ -3,7 +3,7 @@ post_install() { echo "==> Dispatch has been installed." echo " Edit /etc/dispatch/dispatch-api.conf to configure the API." echo " Then enable and start the service:" - echo " systemctl enable --now dispatch-api" + echo " systemctl --user enable --now dispatch-api" echo "" } @@ -11,6 +11,6 @@ post_upgrade() { echo "" echo "==> Dispatch has been upgraded." echo " You may need to restart the service:" - echo " systemctl restart dispatch-api" + echo " systemctl --user restart dispatch-api" echo "" } |
