使用永远运行流星生成的节点包的正确语法是什么? [英] What is the proper syntax for running a meteor generated node bundle using forever?
问题描述
在文档中,在您自己的服务器上运行meteor 的过程是运行
In the docs the procedure to run meteor on your own server is to run
meteor bundle bundle.tgz
然后解压这个压缩包..
Then extract this tarball..
tar -xzvf bundle.tgz
然后启动一个节点服务器
Then start a node server
MONGO_URL=mongodb://localhost:27017/<dbname> PORT=<server_port> ROOT_URL=http://sub.example.com/ node bundle/main.js
我正在尝试使用永远来保持节点服务器正常运行,但是当我运行以下命令(细节模糊)时,永远进程不会返回,我必须按 CTRL+C 才能返回命令行- 非常喜欢.
I'm trying to use forever to keep the node server up, but when I run the following command (specifics obscured), the forever process doesn't return and I have to CTRL+C to get back to the command line - very unforever like.
MONGO_URL=mongodb://localhost:27017/<dbname> PORT=<server_port> ROOT_URL=http://sub.example.com/ forever bundle/main.js
如果我附加一个 & 符号以在后台运行该进程,那么我将返回到命令行,一切看起来都很好,但永远不会生成任何日志或 pid 文件,最终永远进程终止.
If I append an ampersand to run the process in the background then I get back to the command line and everything looks fine, but forever doesn't generate any logs or pid files and eventually the forever process dies.
推荐答案
这对我有用:
export MONGO_URL=mongodb://localhost:27017/<dbname>
export PORT=<server_port>
export ROOT_URL=http://sub.example.com/
forever start bundle/main.js
这篇关于使用永远运行流星生成的节点包的正确语法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!