| Crates.io | gracekill |
| lib.rs | gracekill |
| version | 0.1.1 |
| created_at | 2025-08-04 21:21:27.270593+00 |
| updated_at | 2025-08-04 21:59:45.712922+00 |
| description | A minimal utility to gracefully terminate processes with graceful escalation of SIGTERM to SIGKILL |
| homepage | |
| repository | https://github.com/pato/gracekill |
| max_upload_size | |
| id | 1781212 |
| size | 11,793 |
gracekill - send signals to processes with grace period
gracekill [options]
gracekill sends SIGTERM to the specified process(es) and waits for a configurable grace period before sending SIGKILL to any remaining processes.
The grace period defaults to 30 seconds if not specified.
Multiple PIDs may be specified either space-separated or comma-separated.
pid Process ID to signal. Multiple PIDs can be specified.
-g, --grace-seconds Time in seconds to wait between SIGTERM and SIGKILL. Default: 30
Send SIGTERM to processes 1234 and 5678, wait 10 seconds before SIGKILL:
gracekill -g 10 1234 5678
Send signals to comma-separated PIDs with 30 second grace period:
gracekill --grace-seconds 30 1234,5678,9012
Use default 30 second grace period:
gracekill 1234
Alternative syntax with equals sign:
gracekill --grace-seconds=15 1234
The program sends the following signals in order:
During the grace period, processes are checked every 100ms.
0 All processes exited gracefully within grace period
1 Invalid arguments or usage error
2 No processes could be signaled (all were already dead or inaccessible)
3 Some processes required SIGKILL (did not exit gracefully)
All diagnostic output is written to stderr with "[gracekill]" prefix.
Error messages include:
Install from crates.io:
cargo install gracekill
cargo build --release
Binary will be at target/release/gracekill
Requires appropriate permissions to signal target processes. Only available on Unix-like systems.