diff --git a/tuned/daemon/controller.py b/tuned/daemon/controller.py index 6a59a1d..0dea507 100644 --- a/tuned/daemon/controller.py +++ b/tuned/daemon/controller.py @@ -71,10 +71,16 @@ class Controller(tuned.exports.interfaces.ExportableInterface): self._terminate.set() def sighup(self): - if not self._daemon._sighup_processing.is_set(): - self._daemon._sighup_processing.set() - if not self.reload(): - self._daemon._sighup_processing.clear() + if self._daemon._sighup_processing.is_set(): + self._daemon._sighup_pending.set() + else: + do_reload = True + while do_reload: + self._daemon._sighup_processing.set() + self._daemon._sighup_pending.clear() + if not self.reload(): + self._daemon._sighup_processing.clear() + do_reload = self._daemon._sighup_pending.is_set() @exports.signal("sbs") def profile_changed(self, profile_name, result, errstr): diff --git a/tuned/daemon/daemon.py b/tuned/daemon/daemon.py index 81582d0..d87d8cd 100644 --- a/tuned/daemon/daemon.py +++ b/tuned/daemon/daemon.py @@ -61,6 +61,8 @@ class Daemon(object): self._not_used = threading.Event() # Flag which is set if SIGHUP is being processed self._sighup_processing = threading.Event() + # Flag which is set if there is unprocessed SIGHUP pending + self._sighup_pending = threading.Event() self._not_used.set() self._profile_applied = threading.Event()