How to run meteor on startup on Ubuntu server

git, meteor, ubuntu-12.04

Solution

You should use Ubuntu way, which is Upstart:

http://upstart.ubuntu.com/ http://manpages.ubuntu.com/manpages/lucid/man5/init.5.html

How to define daemon job:

http://newcome.wordpress.com/2012/02/26/running-programs-as-linux-daemons-using-upstart/

Hope it helps :)

Your upstart file would be more or less:

# meteorjs - meteorjs job file

description "MeteorJS"
author "Igor S"

# When to start the service
start on runlevel [2345]

# When to stop the service
stop on runlevel [016]

# Automatically restart process if crashed
respawn

# Essentially lets upstart know the process will detach itself to the background
expect fork

# Run before process
pre-start script
        cd PATH_TO_METEOR_APP
        echo ""
end script

# Start the process
exec meteor run -p 80 --help -- production

Problem

I learn meteorjs and I have a small remote VPS. I want: - Set auto pulling from git repository my meteor project. - Put script into auto start which run my meteor project as service. For example ``` meteor run -p 80 -- production ``` My server is Ubuntu 12.04

Original source