ros2cli.node.daemon module
- ros2cli.node.daemon.add_arguments(parser)
- ros2cli.node.daemon.is_daemon_running(args)
Check if the daemon node is running.
- Parameters:
args – DaemonNode arguments namespace.
- ros2cli.node.daemon.shutdown_daemon(args, timeout=None)
Shut down daemon node if it’s running.
- Parameters:
args – DaemonNode arguments namespace.
timeout – optional duration, in seconds, to wait until the daemon node is fully shut down. Non-positive durations will result in an indefinite wait.
- Returns:
True if the the daemon was shut down, False if it was already shut down.
- Raises:
if it fails to shutdown the daemon.
- ros2cli.node.daemon.spawn_daemon(args, timeout=None, debug=False)
Spawn daemon node if it’s not running.
To avoid TOCTOU races, this function instantiates the XMLRPC server (binding the socket in the process) and transfers it to the daemon process through pipes (sending the inheritable socket with it). In a sense, the socket functionally behaves as a mutex.
- Parameters:
args – DaemonNode arguments namespace.
timeout – optional duration, in seconds, to wait until the daemon node is ready. Non-positive durations will result in an indefinite wait.
debug – if True, the daemon process will output to the current stdout and stderr streams.
- Returns:
True if the the daemon was spawned, False if it was already running.
- Raises:
if it fails to spawn the daemon.