Merge pull request #225 from olysonek/fix-sighup-profile-switch
Fix a hang on SIGHUP when the preset profile does not exist
This commit is contained in:
commit
d35574446d
1 changed files with 7 additions and 5 deletions
|
|
@ -132,14 +132,16 @@ class Controller(tuned.exports.interfaces.ExportableInterface):
|
|||
def reload(self, caller = None):
|
||||
if caller == "":
|
||||
return False
|
||||
if not self._daemon.is_running():
|
||||
return False
|
||||
else:
|
||||
if self._daemon.is_running():
|
||||
stop_ok = self.stop()
|
||||
if not stop_ok:
|
||||
return False
|
||||
try:
|
||||
self._daemon.reload_profile_config()
|
||||
return self.start()
|
||||
except TunedException as e:
|
||||
log.error("Failed to reload Tuned: %s" % e)
|
||||
return False
|
||||
return self.start()
|
||||
|
||||
def _switch_profile(self, profile_name, manual):
|
||||
was_running = self._daemon.is_running()
|
||||
|
|
@ -215,7 +217,7 @@ class Controller(tuned.exports.interfaces.ExportableInterface):
|
|||
if self._daemon.is_running():
|
||||
self._daemon.stop()
|
||||
if self._daemon.is_enabled():
|
||||
self._daemon.set_profile(None, None, save_instantly=True)
|
||||
self._daemon.set_profile(None, True, save_instantly=True)
|
||||
return True
|
||||
|
||||
@exports.export("", "b")
|
||||
|
|
|
|||
Loading…
Reference in a new issue