在 ubuntu 启动时启动屏幕会话

发布于 2024-08-05 04:47:38 字数 430 浏览 5 评论 0原文

我正在使用亚马逊 EC2 作为我正在启动的服务,但是当我尝试在启动脚本(在启动过程中运行)期间启动屏幕会话时,屏幕永远不会启动。我已确保运行 apt-get install screen -y,但是我不确定如何使屏幕正确启动。

有什么帮助吗?

-更新-

这是我的手动屏幕命令的输出,我一定没有输入正确的内容......

root@ip-10-245-118-68:~# screen -A -m -d -S game ./game/orangebox/srcds_run -console -game tf -autoupdate
root@ip-10-245-118-68:~# screen -ls
No Sockets found in /var/run/screen/S-root.

root@ip-10-245-118-68:~# 

I'm using amazon EC2 for a service that I'm starting, however when I try and start a screen session during the startup script (which is ran during the bootup process) the screen never gets started. I've made sure to run apt-get install screen -y, however I'm not sure how to make the screen start correctly.

Any help?

-UPDATE-

here's the output from my manual screen command, I must not be typing the right something...

root@ip-10-245-118-68:~# screen -A -m -d -S game ./game/orangebox/srcds_run -console -game tf -autoupdate
root@ip-10-245-118-68:~# screen -ls
No Sockets found in /var/run/screen/S-root.

root@ip-10-245-118-68:~# 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浅暮の光 2024-08-12 04:47:38

您正在开始分离屏幕。如果您尝试 screen -ls 列出您的 screen 会话或使用 screen -r 或类似方法重新附加,会发生什么情况?

用户第一次运行 screen 时,它会提示输入配置文件并使用一些内容创建 $HOME/.screenrc$HOME/screen-profiles其下的文件。

继续,以 root 身份并让它执行此操作,然后再次尝试启动。也许它在那个提示下挂起。

您需要为 ./game/orangebox/srcds_run 设置绝对路径。将 dot 更改为 /path/to/program

You are starting screen detached. What happens if you try screen -ls to list your screen sessions or reattach using screen -r or similar?

The first time a user runs screen, it prompts for a profile and creates $HOME/.screenrc and $HOME/screen-profiles with some files under it.

Go ahead, as root and let it do that then try your startup again. Maybe it's hanging at that prompt.

You need to put an absolute path for your ./game/orangebox/srcds_run. Instead of dot, change that to /path/to/program

芯好空 2024-08-12 04:47:38

屏幕等待您按 Enter 键的问题大概可以在 /etc/screenrc 中修复,或者在用户通过 $HOME 中的屏幕运行脚本时修复:

    # cat .screenrc 
    startup_message off

The problem of screen waiting for you to press enter can presumably be fixed in /etc/screenrc or in the user running your script via screen in $HOME:

    # cat .screenrc 
    startup_message off
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文