Kill rosbag gracefully via kill
问题 I'd like to kill a rosbag instance gracefully via terminal. Gracefully means in that case, that the rosbag file doesn't have the suffix .active after kill. so I do the following from terminal to send the recommended SIGINT to rosbag: $ rosbag record /some/topic & $ RPID=$! $ # do some stuff $ kill -2 $RPID Unfortunately, the bag remains active and it can happen that not everything was stored to the disk. However, if I put rosbag into a launch file, it seems to work: $ roslaunch rosbag_record