Nohup. But with a little extra.
via go:
$ go get -u github.com/kcmerrill/kj
kj
is a simple process manager that keeps a single(or multiple) processes working. The idea being, you can keep a process running while you're away at lunch. If you need something more sophisticated I'd recommend using supervisord
. kj
is small and lightweight and should be treated as such.
- keep a process running
- keep X number of processes running
- automatically shove processes to the background
- keep logs of stdin/stdout
- log reaping based on log size
The most basic usage is simply to run kj echo hello world
where echo hello world
is the command you want to run. It will spawn the process off in the background, and make sure it can't be interrupted by the hangup signal.
kj --id="name.of.log.file.essentially" --workers=10 --run-once <your_command_here>
The above example will store your logs in a file called name.of.log.file.essentially
. By default, kj
will attempt to keep your process running by restarting it. --run-once
flag will only let the process run once and then kj will exit out when the process completes.