|
@@ -6,9 +6,17 @@ from tracim.lib.daemons import DaemonsManager
|
6
|
6
|
|
7
|
7
|
|
8
|
8
|
class InterruptManager(object):
|
9
|
|
- def __init__(self, daemons_manager: DaemonsManager):
|
|
9
|
+ def __init__(
|
|
10
|
+ self,
|
|
11
|
+ tracim_process_pid: int,
|
|
12
|
+ daemons_manager: DaemonsManager,
|
|
13
|
+ ) -> None:
|
|
14
|
+ """
|
|
15
|
+ :param tracim_process_pid: pid of tracim.
|
|
16
|
+ :param daemons_manager: Tracim daemons manager
|
|
17
|
+ """
|
10
|
18
|
self.daemons_manager = daemons_manager
|
11
|
|
- self.process_pid = os.getpid()
|
|
19
|
+ self.tracim_process_pid = tracim_process_pid
|
12
|
20
|
self._install_sgnal_handlers()
|
13
|
21
|
|
14
|
22
|
def _install_sgnal_handlers(self) -> None:
|
|
@@ -35,4 +43,4 @@ class InterruptManager(object):
|
35
|
43
|
self.daemons_manager.stop_all()
|
36
|
44
|
# Web server is managed by end of stack like uwsgi, apache2.
|
37
|
45
|
# So to ask it's termination, we have to use standard kills signals
|
38
|
|
- os.kill(self.process_pid, signum)
|
|
46
|
+ os.kill(self.tracim_process_pid, signum)
|