I've been trying to write a script that creates a screen session and starts a game server, which I actually managed to do. But the problem is reattaching to that session after detaching... I know the server is running after detaching from the session, but when writing screen -ls
my session does not appear. Even if I type Cntrl+A "
there's no session displayed. Trying screen -r
tells me there's no session but I'm 100% sure there is since the server is still up and typing ps au
shows me the process. What am I doing wrong?
Also, creating a session and running the server in it, detaching and then re-attaching works. It's just when done on a script that it doesn't reattach nor find it.
screen -S "name of server" CodeToRunServer
. I've tried with-d
and-m
as well, with no success. – Zebiano Sep 24 '17 at 21:40