GithubHelp home page GithubHelp logo

Comments (6)

Bluemangoo avatar Bluemangoo commented on May 23, 2024

systemctl服务配置文件里面可以写,用服务吧。

from mcsmanager.

Alex6357 avatar Alex6357 commented on May 23, 2024

能解决大部分问题,但还是有点不方便。我的服务端都放在 /opt 下,这个目录只有 root 有权限,所以如果想创建新的服务端就要进终端先创建个文件夹,或者就得改现在的目录结构。同样这样还是不支持多个用户,不过问题不大,真有需求可以用不同用户开多个 daemon。

from mcsmanager.

unitwk avatar unitwk commented on May 23, 2024

目前如果用 su 切换身份执行会有 bug:如果用 ^C 停止服务器,会直接报 Session terminated, killing shell... ...killed.,服务端不是被正常停止了,而是 su 被强行杀掉了,不会触发服务器的自动保存等,或者干脆卡在停止过程也没法强制停止,取决于是直接用 su 还是在启动脚本里写 su

你说的是「启动命令」处设置 su 相关的命令吗?跟安装脚本没关系吧?

from mcsmanager.

Alex6357 avatar Alex6357 commented on May 23, 2024

你说的是「启动命令」处设置 su 相关的命令吗?跟安装脚本没关系吧?

启动脚本里写 su 意思是写个 start.sh,在里面写 su,启动命令是 start.sh

from mcsmanager.

unitwk avatar unitwk commented on May 23, 2024

你说的是「启动命令」处设置 su 相关的命令吗?跟安装脚本没关系吧?

启动脚本里写 su 意思是写个 start.sh,在里面写 su,启动命令是 start.sh

明白了,MCSManager 启动子进程后,此进程的权限全部继承 MCSManager 的权限,也就是说你的面板 Daemon 程序使用的是什么用户,那么你的实例真实进程就一定会是这个用户,无法更改。

使用 Docker 可以更改。

你在启动脚本中写 su 切换到其他用户,实际上是启动另外一个 shell 子进程,此时你如果输入 ctrl c,那么随着父进程被结束,你的su子进程将会一起被杀死,这是不可避免的。

from mcsmanager.

Alex6357 avatar Alex6357 commented on May 23, 2024

你在启动脚本中写 su 切换到其他用户,实际上是启动另外一个 shell 子进程,此时你如果输入 ctrl c,那么随着父进程被结束,你的su子进程将会一起被杀死,这是不可避免的。

是的。但这样的话服务端收不到 SIGINT 信号,也就没法正常退出。

from mcsmanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.