drain
drain
Gracefully drain the running ephemerd daemon. The daemon stops accepting new jobs and waits for all running jobs to finish before exiting.
ephemerd drainBehavior
- Read PID file – reads
<data-dir>/ephemerd.pidto find the running daemon’s process ID. - Query status – if the gRPC control socket is reachable, prints the current number of active jobs.
- Send SIGTERM – signals the daemon process. The daemon’s signal handler then initiates graceful shutdown.
After sending the signal, the command exits immediately. The daemon continues running in the background until all active jobs complete. Use ephemerd status to monitor progress.
Example
$ ephemerd drain
Active jobs: 3
Sending SIGTERM to ephemerd (pid 12345)...
The daemon will wait for running jobs to finish before exiting.
Use 'ephemerd status' to monitor progress.Notes
- If the PID file does not exist, the command fails with an error indicating the daemon may not be running.
- This command does not forcefully kill the daemon. To force an immediate stop, send
SIGKILLdirectly or useephemerd stop.