No Sockets found: screen script called on startup
bash, linux, shell, sockets, startup
Solution
As Andrew is already alluding to, init scripts are run as root, and screens belong to different users. When you type `screen -ls` you will see the screens of the current user, not all screens on the system.
So yes, `sudo screen -ls` or `sudo screen -r` will do the trick.
Edit (for completeness and future reference): as pointed out by the OP, it is necessary to also add the `-d` flag to the screen command to detach right away in the init script, or else the screen will remain attached.
Problem
I have added a script called screen_tronserver.sh to the /etc/init.d/ directory. I have set the permissions so it is executable and called ``` update-rc.d /etc/init.d/screen_tronserver.sh defaults 100 ``` to add the script to startup. Inside the file is the following: ``` #!/bin/bash echo "creating screen and starting tron server..." screen -S tronserver -m /home/pi/programming/tronserver/a.out ``` The a.out file is a compiled program which runs a server I have created. Now when I call ``` screen -ls ``` It says no sockets found. However, I have tried connecting to the server and it is successful, indicating the screen/socket is there somewhere, running in the background. So why can I not see this mystical socket!?