1
0
Fork 0

Re-raise daemon init exception in no-daemon mode

This way, the exception gets caught in tuned.py,
which prints an error message and exits with
non-zero error code, providing feedback to
tuned-adm. Previously, tuned-adm would have no
way of knowing that TuneD failed.

Resolves: RHEL-71304
This commit is contained in:
Pavol Žáčik 2025-05-06 17:01:20 +02:00
parent 9392599b76
commit 5b72dea0d3
No known key found for this signature in database
GPG key ID: B3029C97EB97E3E4
2 changed files with 3 additions and 1 deletions

View file

@ -303,7 +303,7 @@ class Admin(object):
print("Trying to (re)start tuned...")
(ret, msg) = self._cmd.execute(["service", "tuned", "restart"])
if ret != 0:
raise TunedException("TuneD (re)start failed, you need to (re)start TuneD by hand.")
raise TunedException("TuneD (re)start failed, check TuneD logs for details.")
print("TuneD (re)started.")
def _set_profile(self, profile_name, manual):

View file

@ -51,6 +51,8 @@ class Daemon(object):
self._init_profile(profile_names)
except TunedException as e:
log.error("Cannot set initial profile. No tunings will be enabled: %s" % e)
if not self._daemon:
raise TunedException("Applying TuneD profile failed, check TuneD logs for details.")
def _init_threads(self):
self._thread = None