<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 3, 2014 at 6:32 AM, Phil Bridges <span dir="ltr">&lt;<a href="mailto:gravityhammer@gmail.com" target="_blank">gravityhammer@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks, Hiko.<div><br></div><div>I&#39;ve put in your scripts (ignoring the lirc stuff, because I don&#39;t use it), but I&#39;m getting a syntax error:</div><div><br></div><div><div>/etc/init.d/mythfrontend: line 38: syntax error near unexpected token `then&#39;</div><div>/etc/init.d/mythfrontend: line 38: `        if [ &quot;$(pgrep -u ${MYTH_UID} <a href="http://mythfrontend.re" target="_blank">mythfrontend.re</a>)&quot; ]; then&#39;</div></div><div><br></div><div>Thoughts?</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 27, 2014 at 3:10 PM, Hika van den Hoven <span dir="ltr">&lt;<a href="mailto:hikavdh@gmail.com" target="_blank">hikavdh@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hoi Phil,<br>
<div><div><br>
Monday, October 27, 2014, 6:58:34 PM, you wrote:<br>
<br>
&gt; I&#39;ve recently had to rebuild a couple of my (Gentoo) Myth boxes,<br>
&gt; and I&#39;m not sure exactly what I was using for auto-starting<br>
&gt; Mythfrontend.  What scripts are y&#39;all using for this?<br>
<br>
</div></div>I have the following copied from the gentoo-forums and adapted,<br>
<br>
in /etc/init.d<br>
<br>
#!/sbin/runscript<br>
# Copyright 1999-2006 Gentoo Foundation<br>
# Distributed under the terms of the GNU General Public License v2<br>
# $Header: $<br>
<br>
depend() {<br>
        use mythbackend<br>
}<br>
<br>
start() {<br>
<br>
        ebegin &quot;Starting MythTV Frontend&quot;<br>
<br>
        eindent<br>
<br>
        einfo &quot;Starting mythfrontend&quot;<br>
<br>
        start-stop-daemon --start --quiet --background \<br>
                --user ${MYTH_UID} \<br>
                --exec /usr/bin/startx \<br>
                -- -- ${MYTH_XOPTS} vt${MYTH_VT}<br>
        eend $?<br>
<br>
        if [ -n &quot;${MYTH_IREXEC}&quot; ]; then<br>
<br>
                local name_opt=&quot;${MYTH_IREXEC_NAME:+--name ${MYTH_IREXEC_NAME}}&quot;<br>
<br>
                einfo &quot;Starting irexec&quot;<br>
                start-stop-daemon --start --quiet \<br>
                        --user ${MYTH_UID} \<br>
                        --exec /usr/bin/irexec \<br>
                        -- --daemon ${name_opt} ${MYTH_LIRCRC}<br>
                eend $?<br>
        fi<br>
<br>
        eoutdent<br>
}<br>
<br>
stop() {<br>
        ebegin &quot;Stopping MythTV Frontend&quot;<br>
<br>
        eindent<br>
<br>
        # Make an assumption here: if there are any of these programs running<br>
        # under MYTH_UID, then this script started them, and now needs to kill<br>
        # them.<br>
<br>
        if [ &quot;$(pgrep -u ${MYTH_UID} irexec)&quot; ]; then<br>
                einfo &quot;Terminating irExec&quot;<br>
                start-stop-daemon --stop --exec /usr/bin/irexec \<br>
                        --user ${MYTH_UID} --quiet<br>
                eend $?<br>
        fi<br>
<br>
        if [ &quot;$(pgrep -u ${MYTH_UID} irxevent)&quot; ]; then<br>
                einfo &quot;Terminating irXevent&quot;<br>
                start-stop-daemon --stop --exec /usr/bin/irxevent \<br>
                        --user ${MYTH_UID} --quiet<br>
                eend $?<br>
        fi<br>
<br>
        if [ &quot;$(pgrep -u ${MYTH_UID} <a href="http://mythfrontend.re" target="_blank">mythfrontend.re</a>)&quot; ]; then<br>
                einfo &quot;Terminating MythFrontend&quot;<br>
                start-stop-daemon --stop --name <a href="http://mythfrontend.re" target="_blank">mythfrontend.re</a> \<br>
                        --user ${MYTH_UID} --quiet<br>
                eend $?<br>
        fi<br>
<br>
        if [ &quot;$(pgrep -u ${MYTH_UID} mythlogserver)&quot; ]; then<br>
                einfo &quot;Terminating mythlogserver&quot;<br>
                start-stop-daemon --stop --name mythlogserver \<br>
                        --user ${MYTH_UID} --quiet<br>
<br>
                eend $?<br>
        fi<br>
<br>
        if [ &quot;$(pgrep -u ${MYTH_UID} xclock)&quot; ]; then<br>
                einfo &quot;Terminating X&quot;<br>
                start-stop-daemon --stop --name xclock \<br>
                        --user ${MYTH_UID} --quiet<br>
                eend $?<br>
        fi<br>
<br>
        eoutdent<br>
}<br>
<br>
in /etc/conf.d<br>
<br>
   # User id that all the processes should run as.<br>
   MYTH_UID=&quot;mythtv&quot;<br>
<br>
   # HOME directory.  Needed to find .xinitrc file and .mythtv directory.<br>
   HOME=&quot;/home/${MYTH_UID}&quot;<br>
<br>
   # X runs on the first VT available.  At the point this script runs during<br>
   # system start-up, the gettys haven&#39;t started yet, so the first available VT is<br>
   # VT2.  Then, when the getty on VT2 starts, it grabs the keyboard away from X.<br>
   # To avoid having to turn off gettys in /etc/inittab, tell X where to find an<br>
   # &quot;unreserved&quot; VT.<br>
   MYTH_VT=&quot;7&quot;<br>
<br>
   # If there are any other X server options you want to use, set them here.<br>
   MYTH_XOPTS=&quot;-nolisten tcp -br&quot;<br>
<br>
   # irexec, part of the lirc package, can be used to run commands in response to<br>
   # remote control button presses.  If this variable is set, then irexec will be<br>
   # started and pointed to the appropriate config file.  Leave this blank or null<br>
   # to not start irexec.<br>
   MYTH_IREXEC=&quot;yes&quot;<br>
<br>
   # Name that irexec is configured to respond to in the lircrc file.<br>
   MYTH_IREXEC_NAME=&quot;mythtv&quot;<br>
<br>
   # Where irexec can find the lircrc file.<br>
   MYTH_LIRCRC=&quot;${HOME}/.mythtv/lircrc&quot;<br>
<br>
and ~/.xinitrc<br>
<br>
   # .xinitrc<br>
   cd<br>
   [ -x /usr/bin/nvidia-settings ] &amp;&amp; /usr/bin/nvidia-settings -l<br>
   /usr/bin/xset s noblank<br>
   /usr/bin/xset s off<br>
   /usr/bin/xset -dpms<br>
   #~/.screenlayout/set-768x576i.sh<br>
<br>
   /usr/bin/evilwm \<br>
   -snap 10 -bw 1 \<br>
   -bg rgb:0/0/3fff -fg rgb:0/0/ffff \<br>
   -app xclock/XClock -s \<br>
   -app xterm/XTerm -g 116x41+11+25 \<br>
   -app xmyth/XTerm -v 0 -g 116x39+11+25 \<br>
   -app xstart/XTerm -v 2 -g 116x39+11+25 \<br>
   -app xvnc/XTerm -v 3 -g 116x39+11+25 \<br>
   -app mythfrontend/Mythfrontend -v 0 &amp;<br>
<br>
   exec /usr/bin/xterm -name &quot;xmyth&quot; \<br>
   -bg rgb:0/0/3fff \<br>
   -fg rgb:ffff/ffff/ffff \<br>
   -e ~/.scripts/StartMyth.sh &amp;<br>
<br>
   exec /usr/bin/xterm -name &quot;xstart&quot; \<br>
   -xrm &quot;XTerm.vt100.allowSendEvents: true&quot; \<br>
   -bg rgb:0/0/3fff \<br>
   -fg rgb:ffff/ffff/ffff \<br>
   -e /bin/bash &amp;<br>
<br>
   exec /usr/bin/xterm -name &quot;xvnc&quot; \<br>
   -bg rgb:0/0/3fff \<br>
   -fg rgb:ffff/ffff/ffff \<br>
   -e ~/.scripts/StartVnc.sh &amp;<br>
<br>
   exec xclock -digital -padding 2 -norender -g -0+0 \<br>
   -bg rgb:0/0/3fff \<br>
   -fg rgb:ffff/ffff/ffff<br>
<br>
and StartMyth.sh<br>
<br>
#!/bin/bash<br>
while true; do<br>
        /usr/bin/mythfrontend --syslog local7<br>
        read x<br>
        clear<br>
done<br>
<br>
The clock is this way the X-closing application. Running the frontend<br>
from an Xterm makes the log with an Alt-tab visible. The loop lets me<br>
easily restart. (Actually it has a whole menu with reboot, hibernate<br>
etc. options). The vnc script has a similar loop to restart it. The<br>
extra xterm is there in place of a normal text terminal. The TV is<br>
interlaced vga to scart, so I can&#39;t get a normal console other than<br>
ssh.<br>
<br></blockquote></div></div></div></div></blockquote><div><br></div><div>It appears to not like that position of any of the three if/thens. </div></div></div></div>