Closed zacwitte closed 7 years ago
Sure, please send a PR that does this. You'll want something like:
kill $(< $PIDFILE)
logger -s -p user.info "Waiting for roslaunch process to end"
while kill -0 "$(< $PIDFILE)" 2>/dev/null; do sleep 0.2; done
rm $PIDFILE
We're using robot_upstart to manage our ROS nodes and it's all working great except for the
sudo service ros stop
command. It finishes the command immediately, but the ROS nodes take an extra 10-20 seconds before they actually shut down. This causes big problems if we're trying to restart the software because nodes will be coming up and down at the same time, which makes everything confused.Is it possible for the upstart script to track which pids and all children pids were created and wait until they're all terminated before finishing the command?