<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2627" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>In my situation I haven't used&nbsp;Jarod's power 
button script yet, or even created it.</FONT></DIV>
<DIV><FONT face=Arial size=2>I'm just using myth-load.sh in section 14 of the 
guide.</FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=lunchtimelarry@gmail.com href="mailto:lunchtimelarry@gmail.com">Larry 
  K</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=mythtv-users@mythtv.org 
  href="mailto:mythtv-users@mythtv.org">Discussion about mythtv</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, April 19, 2005 3:18 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [SPAM?] --&gt; Subject: Re: 
  [mythtv-users] Re: VNC launches second mythfrontend</DIV>
  <DIV><BR></DIV>Jarod's "power button" script looks like 
  this:<BR><BR>#!/bin/bash<BR>PROG=mythfrontend<BR>STATUS=`ps -e | grep $PROG | 
  grep -v grep | wc -l | awk '{print $1}'`<BR><BR>if [ $STATUS -eq 0 
  ]<BR>then<BR>&nbsp;&nbsp;&nbsp;&nbsp;( $PROG &amp; 
  )<BR>else<BR>&nbsp;&nbsp;&nbsp;&nbsp;killall $PROG<BR>fi<BR>exit 
  0<BR><BR>Interestingly, I discovered that I could cause 2 instances of 
  mythfrontend, even though it checks for a running instance before it starts 
  another one.&nbsp;&nbsp; I could do a ps -ef | grep frontend and see nothing 
  running, then hit the power button on my remote, and then see 2 instance 
  running.&nbsp; <BR><BR>Does this make sense given that the script is checking 
  for a runnning instance?&nbsp; <BR><BR>
  <DIV><SPAN class=gmail_quote>On 4/19/05, <B class=gmail_sendername>Allan 
  Risk</B> &lt;<A href="mailto:arisk@hamster.foxhollow.ca"> 
  arisk@hamster.foxhollow.ca</A>&gt; wrote:</SPAN>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"><BR>&gt;&gt;&gt;Here's 
    my theory.&nbsp;&nbsp;If anyone has suggestions on how to avoid this it 
    <BR>&gt;&gt;&gt;would<BR>&gt;&gt;&gt;be most 
    welcome.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;I use Jarod's 
    ~/.kde/Autostart/myth-load.sh, which among other 
    things<BR>&gt;&gt;&gt;starts<BR>&gt;&gt;&gt;mythfrontend.<BR>&gt;&gt;&gt;Since 
    vnc starts a new KDE session, I think this gets run again for the 
    <BR>&gt;&gt;&gt;vnc<BR>&gt;&gt;&gt;session and therefore mythfrontend starts 
    a second time.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;I would think this would be 
    common as I suspect many people use 
    both<BR>&gt;&gt;&gt;Jarod's<BR>&gt;&gt;&gt;script and vnc. <BR>&gt;<BR>&gt; 
    add the following into your myth-load.sh file:<BR>&gt;<BR>&gt; ---<BR>&gt; 
    MYTH="`ps ax | grep mythfrontend | grep -v grep`"<BR>&gt;<BR>&gt; if [ ! 
    "$MYTH" ]<BR>&gt; then<BR>&gt;&nbsp;&nbsp; # place all stuff you want to run 
    with mythfrontend here <BR>&gt;&nbsp;&nbsp; 
    /path/to/bin/mythfrontend<BR>&gt; fi<BR>&gt; ---<BR>&gt;<BR>&gt; that checks 
    for a running mythfrontend process and only executes the code<BR>&gt; inside 
    the if/then if there isn't already a mythfrontend process running <BR>&gt; 
    ...<BR>&gt;<BR>&gt; -g-<BR><BR>I tried this method first as I thought this 
    was a nicer way to deal with it.<BR><BR>It worked, but backwards.<BR>It 
    appears that as the vncservice starts the first mythfrontend.<BR>Then when 
    the desired mythfrontend should get started it can't because the<BR>script 
    sees it as already running.<BR><BR>It is nice to see I'm not alone on this 
    though.<BR>I prefer to keep the vnc service on.<BR>I'll look into the other 
    solution about the windows manager.&nbsp;&nbsp;I'll have to <BR>do more 
    reading about that and educate 
    myself.<BR><BR>_______________________________________________<BR>mythtv-users 
    mailing list<BR><A 
    href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</A><BR><A 
    href="http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users">http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users</A><BR></BLOCKQUOTE></DIV><BR>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>mythtv-users mailing 
  list<BR>mythtv-users@mythtv.org<BR>http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users<BR></BLOCKQUOTE></BODY></HTML>