aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_hwd.py
diff options
context:
space:
mode:
Diffstat (limited to 'mpm/python/usrp_hwd.py')
-rwxr-xr-xmpm/python/usrp_hwd.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mpm/python/usrp_hwd.py b/mpm/python/usrp_hwd.py
index e4f64b2f0..b4d556cfd 100755
--- a/mpm/python/usrp_hwd.py
+++ b/mpm/python/usrp_hwd.py
@@ -15,6 +15,7 @@ from gevent import signal
from gevent.hub import BlockingSwitchOutError
import usrp_mpm as mpm
from usrp_mpm.mpmtypes import SharedState
+from usrp_mpm.sys_utils import watchdog
_PROCESSES = []
@@ -147,17 +148,21 @@ def spawn_processes(log, args):
log.info("Spawning RPC process...")
_PROCESSES.append(
mpm.spawn_rpc_process(mpm.mpmtypes.MPM_RPC_PORT, shared, args))
+ log.debug("RPC process has PID: %d", _PROCESSES[-1].pid)
+ if watchdog.has_watchdog():
+ watchdog.transfer_control(_PROCESSES[-1].pid)
log.info("Spawning discovery process...")
_PROCESSES.append(
mpm.spawn_discovery_process(shared, args.discovery_addr)
)
+ log.debug("Discovery process has PID: %d", _PROCESSES[-1].pid)
log.info("Processes launched. Registering signal handlers.")
signal.signal(signal.SIGTERM, kill_time)
signal.signal(signal.SIGINT, kill_time)
- signal.pause()
+ for proc in _PROCESSES:
+ proc.join()
return True
-
def main():
"""
Go, go, go!