Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rpm): Delay Naemon restart until posttrans #456

Merged
merged 1 commit into from
Mar 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions naemon-core.spec
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,8 @@ fi
%post
case "$*" in
2)
# Upgrading so try and restart if already running
# For systemctl systems we need to reload the configs
# becaues it'll complain if we just installed a new
# init script
%if %{?_unitdir:1}0
systemctl daemon-reload &>/dev/null || true
systemctl condrestart naemon.service &>/dev/null || true
%else
/etc/init.d/naemon condrestart &>/dev/null || true
%endif
# Upgrade, don't do anything
# Restarts are handled in posttrans
;;
1)
# install example conf.d only once on the first installation
Expand Down Expand Up @@ -285,6 +277,18 @@ case "$*" in
esac
exit 0

%posttrans
# try and restart if already running
# For systemctl systems we need to reload the configs
# because it'll complain if we just installed a new
# init script
%if %{?_unitdir:1}0
systemctl daemon-reload &>/dev/null || true
systemctl condrestart naemon.service &>/dev/null || true
%else
/etc/init.d/naemon condrestart &>/dev/null || true
%endif



%files
Expand Down
Loading