2014년 5월 26일 월요일

node - backgroud 실행

putty에서 node를 background에서 실행시킨다.
로그만 많이 쌓여서 로그를 없애 버렸다.
centos에서 사용하고 있다.

startup.sh
killall node
nohup node server.js > /dev/null 2>&1 &


  1. nohup means: Do not terminate this process even when the stty is cut off.
  2. > /dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output).
  3. 2>&1 means: stderr also goes to the stdout (which is already redirected to /dev/null).
  4. & at the end means: run this command as a background task.
ref: http://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-die