<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META content=Word.Document name=ProgId>
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<META content="Microsoft Word 10" name=Originator><LINK
href="cid:filelist.xml@01C36BC3.21566250" rel=File-List><!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:SpellingState>Clean</w:SpellingState>
<w:GrammarState>Clean</w:GrammarState>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:EnvelopeVis/>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<STYLE>@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; mso-header-margin: .5in; mso-footer-margin: .5in; mso-paper-source: 0; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal-compose; mso-style-noshow: yes; mso-ansi-font-size: 10.0pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial
}
SPAN.grame {
        mso-style-name: grame
}
SPAN.SpellE {
        mso-style-name: ""; mso-spl-e: yes
}
SPAN.GramE {
        mso-style-name: ""; mso-gram-e: yes
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
        {mso-style-name:"Table Normal";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0in 5.4pt 0in 5.4pt;
        mso-para-margin:0in;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";}
</style>
<![endif]--></HEAD>
<BODY lang=EN-US style="tab-interval: .5in" vLink=purple link=blue>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=401250117-26082003>I use cron to schedule the ending and beginning of
various games which are protected in a 'Screen' session.
</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=401250117-26082003></SPAN></FONT></FONT></FONT> </DIV>
<DIV><SPAN class=401250117-26082003></SPAN><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=401250117-26082003>(to kill a screen
named 'mohaa'): </SPAN>screen -r mohaa -X quit</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=401250117-26082003><FONT face=Arial color=#0000ff size=2>Would
this help?</FONT></SPAN></DIV>
<DIV><SPAN class=401250117-26082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=401250117-26082003><FONT face=Arial color=#0000ff
size=2>L</FONT></SPAN><SPAN class=401250117-26082003><FONT face=Arial
color=#0000ff size=2>uke</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV> </DIV>
<P><FONT face=Arial size=2></FONT></P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Jim Mayes
[mailto:eoeleven@motion.net]<BR><B>Sent:</B> Tuesday, August 26, 2003 12:14
PM<BR><B>To:</B> mohaa@icculus.org<BR><B>Subject:</B> Re: [mohaa] mohaa and
pid's<BR><BR></FONT></DIV>
<DIV class=Section1>
<P class=MsoNormal style="mso-layout-grid-align: none"><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Thanks guys, that info
helped me a lot with my problem too. I've got just one more <SPAN
class=SpellE><SPAN class=GramE>pid</SPAN></SPAN> 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 <SPAN
class=SpellE><SPAN class=GramE>pid</SPAN></SPAN>, 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:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="mso-layout-grid-align: none"><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
style="mso-spacerun: yes"> </SPAN><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="mso-layout-grid-align: none"><SPAN class=GramE><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">screen</SPAN></FONT></SPAN><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> -S <SPAN
class=SpellE>mohaa</SPAN> -m -d ./<SPAN
class=SpellE>stay_alive.sh</SPAN><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="mso-layout-grid-align: none"><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
style="mso-spacerun: yes"> </SPAN><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="mso-layout-grid-align: none"><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">What I need is a way to
get the <SPAN class=SpellE><SPAN class=GramE>pid</SPAN></SPAN> of that screen,
because if I have a <SPAN class=SpellE>pid</SPAN> 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 <SPAN class=SpellE><SPAN class=GramE>pid</SPAN></SPAN>
into a file when the screen is started like:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="mso-layout-grid-align: none"><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
style="mso-spacerun: yes"> </SPAN><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="mso-layout-grid-align: none"><SPAN class=GramE><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">screen</SPAN></FONT></SPAN><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> -S <SPAN
class=SpellE>mohaa</SPAN> -m -d ./<SPAN class=SpellE>stay_alive.sh</SPAN>
& echo $! > <SPAN
class=SpellE>stayalive.pid</SPAN><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="mso-layout-grid-align: none"><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
style="mso-spacerun: yes"> </SPAN><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="mso-layout-grid-align: none"><SPAN class=GramE><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">but</SPAN></FONT></SPAN><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> the <SPAN
class=SpellE>pid</SPAN> that gets written into the file is always 1 lower than
the actually <SPAN class=SpellE>pid</SPAN> for the screen?? Is there some
trick to getting the <SPAN class=SpellE><SPAN class=GramE>pid</SPAN></SPAN> of
a screen? I could just cat <SPAN class=SpellE>stayalive.pid</SPAN>, add 1 to
it and then kill, but I would much rather be working with the actual <SPAN
class=SpellE><SPAN class=GramE>pid</SPAN></SPAN> for the screen. <SPAN
class=GramE>Any ideas?</SPAN><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="mso-layout-grid-align: none"><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="mso-layout-grid-align: none"><FONT face=Arial
size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-no-proof: yes">Jim</SPAN></FONT><FONT
face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>