如何在Ubuntu服务器上启动meteor

Igo*_*bin 7 git meteor ubuntu-12.04

我学习meteorjs,我有一个小型远程VPS.

我想要:

  1. 设置从git存储库我的流星项目自动拉.
  2. 将脚本放入自动启动,将我的meteor项目作为服务运行.

例如

meteor run -p 80 -- production
Run Code Online (Sandbox Code Playgroud)

我的服务器是Ubuntu 12.04

blu*_*zcz 13

你应该使用Ubuntu方式,这是Upstart:

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

如何定义守护进程:

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

希望能帮助到你 :)

你的新贵文件会或多或少:

# 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
Run Code Online (Sandbox Code Playgroud)

  • 当然你想以root身份运行服务器? (4认同)
  • 什么是'exec myprocess`? (2认同)