我学习meteorjs并且我有一个小型远程VPS。
I want:
- 设置自动从 git 存储库拉取我的流星项目。
- 将脚本放入自动启动中,将我的流星项目作为服务运行。
例如
meteor run -p 80 -- production
我的服务器是Ubuntu 12.04
你应该使用 Ubuntu 方式,即 Upstart:
http://upstart.ubuntu.com/ http://upstart.ubuntu.com/
http://manpages.ubuntu.com/manpages/lucid/man5/init.5.html http://manpages.ubuntu.com/manpages/lucid/man5/init.5.html
如何定义守护进程作业:
http://newcome.wordpress.com/2012/02/26/running-programs-as-linux-daemons-using-upstart/ 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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)