daemon: buffer sighup signal
Resolves: RHEL-31180 Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
1fb7c803b6
commit
ef7cfeb729
2 changed files with 12 additions and 4 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue