LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Odd gnu screen issue (https://www.linuxquestions.org/questions/programming-9/odd-gnu-screen-issue-4175416944/)

Roken 07-16-2012 06:21 AM

Odd gnu screen issue
 
I run an opensim server on my system, running in a gnu screen session. I have a bash "watchdog" script that:

Checks that the server is running and if not, starts/restarts it.
Checks the CPU use of the server and issues a message to the simulation that the server will restart in 1 minute, and then kills the server to let the restart routine start it up again.
Checks the number of in world users and disables server scripts if there are none (re-enabling them when a user arrives).

The script is working well, except that after restarting, nothing else gets done (the script continues as normal, put putting commands to the server via screen -r server -X stuff "..." doesn't yield any output. If, however, I attach the screen session to a terminal/tty and then immediately detach it, the script behaves as expected.

The script is launched from rc.local at bootime via su username (so not running as root), and the server is started with "screen -d -m ......"

Has anyone observed this behaviour and can offer a solution?

TIA


All times are GMT -5. The time now is 02:07 AM.