Closed endofzero closed 13 years ago
What line is throwing the error? This could be handled pretty easily with code like:
RUNNING=$(kill -0 $PID)
if [ 0 -eq $RUNNING ]; then
# We have a process at that PID
else
# No such PID
fi
Commenting out this line removed the error... so I'm guessing here...
MC_PID=$(ps --ppid $SCREEN_PID -F -C java | tail -1 | awk '{print $2}')
I output SCREEN_PID to see what is passed
No Sockets found in /var/run/screen/S-minecraft.
So maybe we just need to add a clause that states that if is says "No Sockets found*" or something like that, that the screen doesn't exist. From the looks of it... it is always passing a variable, which seems to always makes this false: if [[ -z $SCREEN_PID ]]; then
This is fixed in my current pull request.
I just tested the change and it is giving me the same results.
Really? That's.. baffling. I tested it on BSD and Linux. When no screens are running, the variable is a null string, which [[ -z $SCREEN_PID ]] returns as true. What version of screen are you running? $screen --version Screen version 4.00.03jw4 (FAU) 2-May-06
Ah, I think I found the difference- I'll make one more change and update the pull request.
Alright... second time was the charm...
Maybe if we push the text into /dev/null as the error doesn't really seem to cause any issues other than just the display of the error. Really just any way to suppress that should work.