Ask Your Question

How to shutdown all nodes

asked 2016-08-20 20:34:17 -0500

Cerin gravatar image

What's the easiest way to signal all nodes to shutdown?

I created a daemon that runs several launch files in the background, but now that even if I kill the roscore, the other nodes don't end, they just keep running, forcing me to hunt them down and manually kill each process.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-01-14 10:40:03 -0500

AlexandruIftimie gravatar image

Late answer but worth doing so. rosnode kill -a will terminate correctly all nodes.

For example before I was terminating all processes by using killall -u user_name, and this managed the rtabmap node to corrupt the database. With the command I first mentioned, no more corruption happens.

edit flag offensive delete link more



rosnode kill -a is a nice way to shutdown nodes, as it gives them time to properly close files, stop timers, etc, but do know that it'll only work as long as your roscore is running. If that is gone, it won't be able to find the running nodes anymore.

gvdhoorn gravatar image gvdhoorn  ( 2018-01-14 11:20:41 -0500 )edit

It seems that this doesn't work for respawn nodes, though (unless you have at least one required node).

peci1 gravatar image peci1  ( 2021-02-01 16:19:33 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2016-08-20 20:34:17 -0500

Seen: 6,715 times

Last updated: Jan 14 '18