Skip to content

Commit

Permalink
spec: Start tuned-ppd right away if swapping from active PPD
Browse files Browse the repository at this point in the history
Related: rhbz#2292636
  • Loading branch information
zacikpa committed Jun 21, 2024
1 parent 1706bb4 commit 883ba34
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tuned.spec
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,14 @@ fi
/usr/sbin/chkconfig --del ktune &>/dev/null || :


%triggerun ppd -- power-profiles-daemon
# if swapping power-profiles-daemon for tuned-ppd, check whether it is active
if systemctl is-active --quiet power-profiles-daemon; then
mkdir -p %{_localstatedir}/lib/rpm-state/tuned
touch %{_localstatedir}/lib/rpm-state/tuned/ppd-active
fi


%posttrans
# conditional support for grub2, grub2 is not available on all architectures
# and tuned is noarch package, thus the following hack is needed
Expand All @@ -416,6 +424,15 @@ if [ -d %{_sysconfdir}/grub.d ]; then
fi


%posttrans ppd
# if power-profiles-daemon was active before installing tuned-ppd,
# start tuned-ppd right away
if [ -f %{_localstatedir}/lib/rpm-state/tuned/ppd-active ]; then
systemctl start tuned-ppd
rm -rf %{_localstatedir}/lib/rpm-state/tuned
fi


%files
%exclude %{docdir}/README.utils
%exclude %{docdir}/README.scomes
Expand Down

0 comments on commit 883ba34

Please sign in to comment.