From a084c2d811dd62f594c4b776185eddcd1db2bc80 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Sun, 27 Dec 2020 16:18:22 +0200 Subject: [PATCH] Improve service processing --- rpm/harbour-batterybuddy.spec | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rpm/harbour-batterybuddy.spec b/rpm/harbour-batterybuddy.spec index 585a1c6..f5132f4 100644 --- a/rpm/harbour-batterybuddy.spec +++ b/rpm/harbour-batterybuddy.spec @@ -91,18 +91,16 @@ rm /etc/systemd/system/%{name}-oneshot.service || true # Install/update permission daemon (root) cp %{_datadir}/%{name}/service/%{name}-oneshot.service %{_unitdir}/%{name}-oneshot.service +systemctl daemon-reload systemctl start %{name}-oneshot.service systemctl enable %{name}-oneshot.service # Install/update background daemon (default user) cp %{_datadir}/%{name}/service/%{name}.service %{_userunitdir}/%{name}.service +su $SFOSUSER -c "systemctl --user daemon-reload" su $SFOSUSER -c "systemctl --user start %{name}.service" su $SFOSUSER -c "systemctl --user enable %{name}.service" -# Cleanup -systemctl daemon-reload -systemctl reset-failed - %postun # Figure out the default user name