Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use generic SIGINT parameter in kill command for gazebo script #711

Merged
merged 2 commits into from
May 24, 2018

Conversation

j-rivero
Copy link
Contributor

issue #485

Use the -N notation for send -2 to the kill command of gzserver. It is supported in both Mac and Linux. I added some checks with kill -0 to check that the process is indeed running.

GAZEBO_MASTER_URI="$desired_master_uri" GAZEBO_MODEL_DATABASE_URI="$desired_model_database_uri" gzserver $final &
gzserver_pid="$!"
# Use kill -0 to check if the process is running
if $(kill -0 $! > /dev/null); then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend redirecting stderr 2> instead of stdout because kill will write to stderr if that process does not exist.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise worked great in my testing!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call: b332777

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants