This is a weird situation I've run into. We have a test server off site (or off site from where I work). To access the server, I need to VPN into its network.
I ran screen to execute a long running process. After I started the process, I did the following to check screen's viability:
- I detached from the session
- performed screen -ls to check the PID
- ps -ef | grep screen
- screen -r PID
I could see there was a screen session after running these commands and re-attaching/detaching to the session.
Here's the weird part. I come back the next day and there is no screen sessions. I ran those cmds above to check but there's nothing. However, my process is still running. I didn't use nohup to run my process but for some lucky reason, my process didn't die with the session.
Does anyone know what might have happened? Why did I lose my screen session and why did I luck out and have my process keep running?
Thanks for any enlightenment. =)
Best Answer
You might want to grep for
SCREEN
instead to verify that your screen really isn't running.Some systems have tmp cleaners that delete files in
/tmp
,/var/tmp
,/var/run
, or similar. This can result inscreen
not being able to find its socket files. If you can identify the PID of your session, you can dokill -CHLD <PID>
to tellscreen
to rewrite its socket file.screen -r
should then work again.If this is what's happening, you should probably configure
screen
to use another directory for its sockets.