bind-to-file
v1.0.0
Published
Start a command bound to a control file, then exit; delete the control file to stop it. Detached watcher, process-group kill, capped log.
Maintainers
Readme
bind-to-file
Start a command bound to a control file, then exit immediately (daemonize).
A detached watcher kills the command's process group when the control file is
deleted. Command stdout/stderr go to a .log file by default, with a size cap.
npx bind-to-file /tmp/job.run -- sleep 3600 # log -> /tmp/job.log
rm /tmp/job.run # stops the jobPOSIX only (Linux/macOS). See npx bind-to-file --help for all options
(-i interval, -s signal, -k kill-after, -l log path, -S max-size,
-n no-create, --no-log).
