Skip to content

Commit

Permalink
Fix enable/disable on debian?
Browse files Browse the repository at this point in the history
  • Loading branch information
jomann09 committed Feb 15, 2023
1 parent aeac425 commit d8e59ff
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions build/package/rcagent.spec
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,22 @@ getent passwd rcagent >/dev/null || \

%post
%{_sbindir}/%{name} -a install &> /dev/null
%systemd_post %{name}.service &> /dev/null
if command -v systemctl > /dev/null
then
systemctl disable %{name}.service &> /dev/null
fi

%preun
%systemd_preun %{name}.service
# On uninstall stop before removing
if [ "$1" != "1" ]
then
systemctl stop %{name}.service &> /dev/null
fi
%{_sbindir}/%{name} -a uninstall &> /dev/null

%files
%config(noreplace) %{_sysconfdir}/%{name}/config.yml
%{_sbindir}/%{name}


%dir %{_libdir}/%{name}/plugins

0 comments on commit d8e59ff

Please sign in to comment.