If you use this script on a crontab, and the account has email forwarding enabled, you'll get spammed with terminated messages from bash, even though you are catching stdout with > /dev/null
I tried pkill, but that didn't work with wait. and we currently only store that paren't PID which will kill the bash running node, but not node. Hence the subshell to find the process group ID and use kill. It might be more elegant to just save the process group ID from the get go, but this works well without refactoring.
https://stackoverflow.com/questions/5719030/bash-silently-kill-background-function-process
If you use this script on a crontab, and the account has email forwarding enabled, you'll get spammed with terminated messages from bash, even though you are catching stdout with
> /dev/null
I tried pkill, but that didn't work with wait. and we currently only store that paren't PID which will kill the bash running node, but not node. Hence the subshell to find the process group ID and use kill. It might be more elegant to just save the process group ID from the get go, but this works well without refactoring. https://stackoverflow.com/questions/5719030/bash-silently-kill-background-function-process