Improve service processing

This commit is contained in:
Matti Viljanen 2020-12-27 16:18:22 +02:00
parent 07c463b238
commit a084c2d811

View file

@ -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