FG
šŸ’» Software

Kill bash processes "nicely"

Fresh6 days ago
Mar 15, 20263732 views
Confidence Score0%
0%

Problem

I'm trying to avoid for the reasons described in the Useless Use of Kill -9 form letter. Is this function sufficient, or do I need to kill the processes after a timeout or take care of other subtleties? As an aside, what's a better name for this function? The current name reminds me of "Killing Me …

Error Output

soft_kill()
{
    # Try to avoid forcing a kill
    # @param $1: PID
    kill $1 || kill -INT $1 || kill -HUP $1 || \
    (echo "Could not kill $1" >…

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Kill bash processes "nicely"

Low Risk

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment