Skip to content

Instantly share code, notes, and snippets.

@tjchaplin
Created August 19, 2013 15:45
Show Gist options
  • Save tjchaplin/6270595 to your computer and use it in GitHub Desktop.
Save tjchaplin/6270595 to your computer and use it in GitHub Desktop.
Kill Node App on remote server

#Kill node processes

##Kill all node processes

killall node 

##Kill specfic node process

//If you start your app like this:
node /var/www/MYApp

Then you can stop it explictily like:

ps auxwwwe | egrep " [n]ode" | grep "APPLICATION NAME" | awk '{print $2 }'| xargs kill &> /dev/null

##grunt-ssh task

sshexec: {
    stopApp: {
        command: 'killall -q node  &> /dev/null',
        options: {
          host: 'localhost',
          username: 'userName',
          password: 'password'
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment