redhat-performance / tuned

Tuning Profile Delivery Mechanism for Linux
GNU General Public License v2.0
751 stars 171 forks source link

Re-check dbus when (re)starting TuneD from tuned-adm profile #627

Closed zacikpa closed 1 month ago

zacikpa commented 2 months ago

When TuneD is off, and a profile is applied using tuned-adm profile, the command attempts to start it. Before this change, the profile would always be applied via the active_profile file.

When TuneD supports DBus, we can change the profile via a DBus call instead, and thus get information about the result. After the restart, I therefore added a new check which determines whether TuneD is on the dbus. If it's not, we fallback to the original profile activation.

The only disadvantage of this approach is that TuneD is restarted twice in the unlikely scenario that both enable_dbus and daemon are turned on, but TuneD does not become active on the DBus after a restart. This would, however, signalize some misconfiguration because if the TuneD service unit has type=dbus set, restarting the service hangs until it becomes active on the DBus.

Resolves #623.

yarda commented 1 month ago

Thanks, LGTM, but the changed output messages will require update of the Beaker tests.