Monday, 4 August 2014

Node.js: Servidor sempre online – Keep server always running

Aqui um script pra fazer seu server em Node.js rodar ao iniciar sua máquina e deixá-lo rodando em background. (testei no ubuntu)

description "node.js server"
author      "kvz - http://kevin.vanzonneveld.net"

# used to be: start on startup
# until we found some mounts weren't ready yet while booting:
start on started mountall
stop on shutdown

# Automatically Respawn:
respawn
respawn limit 99 5

script
    export HOME="/root/path/to/your/nodejs/app"
    cd $HOME
    exec yourprogram.js >> $HOME/node.log 2>&1
end script

post-start script
   # Optionally put a script here that will notifiy you node has (re)started
   # /root/bin/hoptoad.sh "node.js has started!"
end script

Friday, 25 July 2014

Monday, 14 July 2014

Thursday, 5 June 2014

Wednesday, 14 May 2014