Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是否添加绝对路径变量? #51

Closed
TelDragon opened this issue Jul 23, 2018 · 3 comments
Closed

是否添加绝对路径变量? #51

TelDragon opened this issue Jul 23, 2018 · 3 comments

Comments

@TelDragon
Copy link

尊敬的作者您好,
我非常喜欢该应用,但是我再使用时遇到一个不便的情况。
我想使用第三方工具来守护此服务,例如 systemctl 或 forerver 。
但是我查看了下本项目的 app.js 貌似路径获取是当前目录。因此导致 无法守护,

可不可以增加一个绝对路径变量 或者其他的方式,能让我来对该服务进行守护。

@unitwk
Copy link
Member

unitwk commented Jul 24, 2018

感谢反馈!

这个项目中确实很多地方使用了相对路径,对于这种绝对路径变量的需求,暂时性还是做不到。
十分抱歉。

@ghost
Copy link

ghost commented Jul 25, 2018

阁下可以尝试将此应用程序注册为一个系统服务,这样可以就通过 service 命令进行管理了。也可以尝试用 Shell 实现,见知乎

@ghost
Copy link

ghost commented Aug 22, 2018

这个项目可以使用 forever 守护,你可以试试写一个脚本,脚本实现如下:

  • 先 cd 到项目目录下
  • 再使用 forever start app.js

即:

#!/bin/bash
cd <path-to-mcsm>
forever start app.js

这个方法以及在我的服务器上成功实现,系统环境:Debian 9。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants