Skip to content

Commit

Permalink
feat: start host-metering service on rpm installation
Browse files Browse the repository at this point in the history
The host-metering.service is started at the end of transaction if the
service is enabled. It is enabled by preset, so it is possible to
disable it also by other preset with higher priority.

It's in selinux poststrans as it was otherwise failing with permissions
issues.

Overall this is a hack and e.g. might be against Fedora packaging
policy.

https://issues.redhat.com/browse/HMS-3358

Signed-off-by: Petr Vobornik <[email protected]>
  • Loading branch information
pvoborni committed Jan 8, 2024
1 parent c3dace3 commit 5687c01
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contrib/rpm/host-metering.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ if [ $1 -eq 0 ]; then
%selinux_relabel_post -s %{selinuxtype}
fi

%posttrans selinux
if [ $1 -le 1 ] ; then
/bin/systemctl is-enabled host-metering.service >/dev/null 2>&1
if [ $? -eq 0 ]; then
/bin/systemctl restart host-metering.service >/dev/null || :
fi
fi

%files
%doc README.md
%{_bindir}/*
Expand Down

0 comments on commit 5687c01

Please sign in to comment.