0
$\begingroup$

Rosanswers logo

I killed my_node using

rosnode kill my_node

When printing a list of nodes

rosnode list

my_node is not showing up the nodes, but it is running in the background and I confirmed it using the following command:

ps aux | grep my_node | grep -v grep | awk '{print $2}'

This shows a list of my_node, because I started the my_node many times.

kill $(ps aux | grep my_node | grep -v grep | awk '{print $2}')

Is not killing any of the nodes

I have tried, pkill as well without any luck. Only way to get out of this issue is to restart roscore

I would like to know if there is any other way to kill the node?


Originally posted by tosandip on ROS Answers with karma: 35 on 2015-06-19

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It's quite likely that your node is stuck in an infinite loop somewhere or is never initializing ROS.

Usually, kill sends SIGINT, which can be caught by the process so that it can terminate gracefully. It sounds like your process is stuck somehow, and this signal is caught and ignored.

You can also tell kill to send the SIGKILL signal, which cannot be caught and causes your program to terminate immediately. You can tell kill to send the SIGKILL by name: kill -KILL or by number kill -9

Once you've cleared out any runaway processes, you should go through your code and try to understand why it's getting stuck; otherwise they'll just keep running away from you.


Originally posted by ahendrix with karma: 47576 on 2015-06-20

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by tosandip on 2015-06-22:
Thanks that helped.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.