PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.58k stars 13.56k forks source link

shutdown command is not completely killing the processes. #23880

Open rajeev-gupta-bashrc opened 3 weeks ago

rajeev-gupta-bashrc commented 3 weeks ago

In the gazebo simulation the shutdown command doesn't kills the gz server, and the gazebo gui remains open with the terminal being unresponsive. If we further kill the background processes by ctrl+c then gazebo doesn't open for the next time. We need to restart the pc (this restarting issue is related to gazebo/gz-server if we don't properly kill the gz-server).

rajeev-gupta-bashrc commented 3 weeks ago

Solved using this: https://github.com/PX4/PX4-Autopilot/pull/23881/files image

dakejahl commented 3 weeks ago

why not just use ctrl+c?

rajeev-gupta-bashrc commented 3 weeks ago

@dakejahl actually we wanted to automate the launch and shut down process, that's why ctrl+c wasn't an option for us. We feed the kill command and it kills the process. Thank you for looking into it. If you can suggest some changes, we welcome you.

dakejahl commented 2 weeks ago

@rajeev-gupta-bashrc if you're automating the launch/shutdown you can just kill the process from your own scripts? Ctrl+C is just sending SIGINT. I don't think adding a pkill -f to the cpp code is the right place to do it.