If you are only running one java process, then I think you should only need one screen process running. "screen -r" will reattach to an in-attached screen instance, but won't capture another screen instance that is already connected to by another console. See "man screen" for details, but "screen -d -R" might be what you are looking for. This is an extract from the manual:
Code:
-d -r Reattach a session and if necessary detach it first.
-d -R Reattach a session and if necessary detach or even create it first.
-d -RR Reattach a session and if necessary detach or create it. Use the first session if more than one session is available.
-D -r Reattach a session. If necessary detach and logout remotely first.
-D -R Attach here and now. In detail this means: If a session is running, then reattach. If necessary detach and logout remotely first. If it was not running create it and notify the
user. This is the author's favorite.
-D -RR Attach here and now. Whatever that means, just do it.
Note: It is always a good idea to check the status of your sessions by means of "screen -list".
I was sure there was a way to have multiple consoled attached to the same screen session (for doing demos in the classroom etc.) but I can't find that in the man pages now. Still, as you see above, you can forcibly disconnect the old console when connecting from a new one.
Or maybe I'm not understanding what your problem is now. Please explain further if that's the case.
Bookmarks