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

Introduce SIGKILL to ensure process has terminated after MAXWAIT #9

Closed
wants to merge 1 commit into from
Closed

Conversation

lusitania
Copy link

This PR enables the init script to SIGKILL the process group of the service after MAXWAIT has expired. The feature is set in /etc/default/collectd and enabled by default:

declare -i USE_SIGKILL=1

echo -n " ."

if test $i -gt $MAXWAIT; then
if (( $i > $MAXWAIT )); then
Copy link
Member

Choose a reason for hiding this comment

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

This is an unrelated change. Please move it into a separate commit.

@@ -12,6 +12,10 @@ USE_COLLECTDMON=1
# default: 30
MAXWAIT=30

# try a terminal kill -9 if the process refuses to shut down
# default: 0
declare -i USE_SIGKILL=1
Copy link
Member

Choose a reason for hiding this comment

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

This is a very generic name, missing the context of where this would be applied. Can you think of something better? I don't have a good idea myself yet but something along the lines of KILL_AFTER_WAIT or similar.

@@ -12,6 +12,10 @@ USE_COLLECTDMON=1
# default: 30
MAXWAIT=30

# try a terminal kill -9 if the process refuses to shut down
# default: 0
declare -i USE_SIGKILL=1
Copy link
Member

Choose a reason for hiding this comment

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

This will set the default value to 1 instead of 0.

@@ -12,6 +12,10 @@ USE_COLLECTDMON=1
# default: 30
MAXWAIT=30

# try a terminal kill -9 if the process refuses to shut down
# default: 0
declare -i USE_SIGKILL=1
Copy link
Member

Choose a reason for hiding this comment

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

For consistency with other settings, please don't use declare. I'm fine with a separate commit changing this globally.

@tokkee
Copy link
Member

tokkee commented Oct 21, 2017

Any update on this?

On second thought, I think it would be better to convert this code to use start-stop-daemon's --retry flag.

@lusitania lusitania closed this Aug 18, 2021
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.

2 participants