Starting a screen session on startup with ubuntu
-
07-07-2019 - |
Question
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:~#
Solution
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
OTHER TIPS
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