如何在Ubuntu服务器启动时运行meteor [英] How to run meteor on startup on Ubuntu server
问题描述
我想:
- 设置自动从git存储库中取出我的meteor项目。
- 将脚本放入自动启动,将我的流星项目作为服务运行。
$ b例如
meteor run -p 80 - 制作
我的服务器是Ubuntu 12.04
解决方案你应该使用Ubuntu的方式,这是Upstart:
$ b http://upstart.ubuntu.com/
http://manpages.ubuntu.com/manpages/lucid/man5/init.5.html
如何定义守护进程作业:
p>
http://newcome.wordpress.com/2012/02/26/running-programs-as-linu x-daemons-using-upstart /
希望它有帮助:)
你的新贵档案或多或少:
#meteorjs - meteorjs工作文件
描述MeteorJS
作者Igor S
#何时开始服务
从runlevel开始[2345]
#何时停止服务
停止在运行级别
#如果崩溃,自动重启进程
respawn
#本质上让新手知道进程将自己分离到后台
期望fork
#在进程前运行
预启动脚本
cd PATH_TO_METEOR_APP
echo
结束脚本
#启动流程
exec meteor run -p 80 --help - production
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
解决方案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
这篇关于如何在Ubuntu服务器启动时运行meteor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!