Skip to content

Commit

Permalink
Also handle SIGTERM gracefully (#2747)
Browse files Browse the repository at this point in the history
Signed-off-by: Erling Rennemo Jellum
Signed-off-by: erlingrj <erling.jellum@gmail.com>
Signed-off-by: erling <erling.jellum@gmail.com>
Co-authored-by: Addisu Z. Taddese <addisu@openrobotics.org>
Co-authored-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 13bf5be)

# Conflicts:
#	src/cmd/cmdgazebo.rb.in
  • Loading branch information
erlingrj authored and mergify[bot] committed Feb 1, 2025
1 parent 2f1c49f commit 6b89daa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/cmd/cmdgazebo.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,25 @@ See https://github.com/gazebosim/gz-sim/issues/168 for more info."
options['wait_gui'], options['render_engine_gui'])
end

<<<<<<< HEAD:src/cmd/cmdgazebo.rb.in
Signal.trap("INT") {
self.killProcess(guiPid, "Ignition Gazebo GUI", 5.0)
self.killProcess(serverPid, "Ignition Gazebo Server", 5.0)
=======
# Handle SIGINT and SIGTERM signals
def handle_signal(guiPid, serverPid)
self.killProcess(guiPid, "Gazebo Sim GUI", 5.0)
self.killProcess(serverPid, "Gazebo Sim Server", 5.0)
end

Signal.trap("INT") {
handle_signal(guiPid, serverPid)
return 1
}

Signal.trap("TERM") {
handle_signal(guiPid, serverPid)
>>>>>>> 13bf5bea (Also handle SIGTERM gracefully (#2747)):src/cmd/cmdsim.rb.in
return 1
}

Expand Down

0 comments on commit 6b89daa

Please sign in to comment.