[mohaa] mohaa and pid's

Salsich, Luke LJS at protectorgroup.com
Tue Aug 26 13:03:11 EDT 2003


I use cron to schedule the ending and beginning of various games which
are protected in a 'Screen' session. 
 
(to kill a screen named 'mohaa'):  screen -r mohaa -X quit
 
Would this help?
 
Luke
 
 
 
-----Original Message-----
From: Jim Mayes [mailto:eoeleven at motion.net]
Sent: Tuesday, August 26, 2003 12:14 PM
To: mohaa at icculus.org
Subject: Re: [mohaa] mohaa and pid's


Thanks guys, that info helped me a lot with my problem too. I've got
just one more pid problem that I wondering if someone could maybe shed
some light on. Much like Josh's situation I have a screened "stay alive"
function. So when I kill the server's pid, the stay alive restarts it.
Now, I have a loader script that I use to launch this "stay alive"
script in a detached screen like so:
 
screen -S mohaa -m -d ./stay_alive.sh
 
What I need is a way to get the pid of that screen, because if I have a
pid for it I can stop the stay alive process too so the server doesn't
automatically restart (giving me start/stop/restart functionality!!). So
I tried the same idea and added the command to echo the pid into a file
when the screen is started like:
 
screen -S mohaa -m -d ./stay_alive.sh & echo $! > stayalive.pid
 
but the pid that gets written into the file is always 1 lower than the
actually pid for the screen?? Is there some trick to getting the pid of
a screen? I could just cat stayalive.pid, add 1 to it and then kill, but
I would much rather be working with the actual pid for the screen. Any
ideas?
 
Jim
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/mohaa/attachments/20030826/f5f54f71/attachment.htm>


More information about the Mohaa mailing list