在 ubuntu 启动时启动屏幕会话
我正在使用亚马逊 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在开始分离
屏幕
。如果您尝试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 tryscreen -ls
to list yourscreen
sessions or reattach usingscreen -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 ofdot
, change that to/path/to/program
屏幕等待您按 Enter 键的问题大概可以在 /etc/screenrc 中修复,或者在用户通过 $HOME 中的屏幕运行脚本时修复:
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: