1
0
Fork 0

Merge pull request #143 from TomasKorbar/rhbz1631744

Reload profile configuration on SIGHUP
This commit is contained in:
Jaroslav Škarvada 2019-01-31 16:43:47 +01:00 committed by GitHub
commit 17c44cca27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -135,7 +135,11 @@ class Controller(tuned.exports.interfaces.ExportableInterface):
if not self._daemon.is_running():
return False
else:
return self.stop() and self.start()
stop_ok = self.stop()
if not stop_ok:
return False
self._daemon.reload_profile_config()
return self.start()
def _switch_profile(self, profile_name, manual):
was_running = self._daemon.is_running()

View file

@ -59,6 +59,10 @@ class Daemon(object):
self._not_used.set()
self._profile_applied = threading.Event()
def reload_profile_config(self):
"""Read configuration files again and load profile according to them"""
self._init_profile(None)
def _init_profile(self, profile_names):
manual = True
if profile_names is None: