Monitor a program and resume it when it dies, either exiting abnormally or killed by OOM in linux.
Usage:
./forever /usr/bin/BINARY_NAME options
Example:
CWD=./myproject/ ./forever ~/.nvm/versions/node/v8.14.0/bin/node server.js -t
Note:
Make sure monitor the right process, the executable, don't exit. Cause we will monitor its pid.
Build universal version:
cc forever.c -O -o forever
Deprecated:
Build osx version:
cc forever-osx.c -framework CoreFoundation -O -o forever-osx