<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"><<a href="mailto:gravityhammer@gmail.com" target="_blank">gravityhammer@gmail.com</a>></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've put in your scripts (ignoring the lirc stuff, because I don't use it), but I'm getting a syntax error:</div><div><br></div><div><div>/etc/init.d/mythfrontend: line 38: syntax error near unexpected token `then'</div><div>/etc/init.d/mythfrontend: line 38: ` if [ "$(pgrep -u ${MYTH_UID} <a href="http://mythfrontend.re" target="_blank">mythfrontend.re</a>)" ]; then'</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"><<a href="mailto:hikavdh@gmail.com" target="_blank">hikavdh@gmail.com</a>></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>
> I've recently had to rebuild a couple of my (Gentoo) Myth boxes,<br>
> and I'm not sure exactly what I was using for auto-starting<br>
> Mythfrontend. What scripts are y'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 "Starting MythTV Frontend"<br>
<br>
eindent<br>
<br>
einfo "Starting mythfrontend"<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 "${MYTH_IREXEC}" ]; then<br>
<br>
local name_opt="${MYTH_IREXEC_NAME:+--name ${MYTH_IREXEC_NAME}}"<br>
<br>
einfo "Starting irexec"<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 "Stopping MythTV Frontend"<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 [ "$(pgrep -u ${MYTH_UID} irexec)" ]; then<br>
einfo "Terminating irExec"<br>
start-stop-daemon --stop --exec /usr/bin/irexec \<br>
--user ${MYTH_UID} --quiet<br>
eend $?<br>
fi<br>
<br>
if [ "$(pgrep -u ${MYTH_UID} irxevent)" ]; then<br>
einfo "Terminating irXevent"<br>
start-stop-daemon --stop --exec /usr/bin/irxevent \<br>
--user ${MYTH_UID} --quiet<br>
eend $?<br>
fi<br>
<br>
if [ "$(pgrep -u ${MYTH_UID} <a href="http://mythfrontend.re" target="_blank">mythfrontend.re</a>)" ]; then<br>
einfo "Terminating MythFrontend"<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 [ "$(pgrep -u ${MYTH_UID} mythlogserver)" ]; then<br>
einfo "Terminating mythlogserver"<br>
start-stop-daemon --stop --name mythlogserver \<br>
--user ${MYTH_UID} --quiet<br>
<br>
eend $?<br>
fi<br>
<br>
if [ "$(pgrep -u ${MYTH_UID} xclock)" ]; then<br>
einfo "Terminating X"<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="mythtv"<br>
<br>
# HOME directory. Needed to find .xinitrc file and .mythtv directory.<br>
HOME="/home/${MYTH_UID}"<br>
<br>
# X runs on the first VT available. At the point this script runs during<br>
# system start-up, the gettys haven'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>
# "unreserved" VT.<br>
MYTH_VT="7"<br>
<br>
# If there are any other X server options you want to use, set them here.<br>
MYTH_XOPTS="-nolisten tcp -br"<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="yes"<br>
<br>
# Name that irexec is configured to respond to in the lircrc file.<br>
MYTH_IREXEC_NAME="mythtv"<br>
<br>
# Where irexec can find the lircrc file.<br>
MYTH_LIRCRC="${HOME}/.mythtv/lircrc"<br>
<br>
and ~/.xinitrc<br>
<br>
# .xinitrc<br>
cd<br>
[ -x /usr/bin/nvidia-settings ] && /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 &<br>
<br>
exec /usr/bin/xterm -name "xmyth" \<br>
-bg rgb:0/0/3fff \<br>
-fg rgb:ffff/ffff/ffff \<br>
-e ~/.scripts/StartMyth.sh &<br>
<br>
exec /usr/bin/xterm -name "xstart" \<br>
-xrm "XTerm.vt100.allowSendEvents: true" \<br>
-bg rgb:0/0/3fff \<br>
-fg rgb:ffff/ffff/ffff \<br>
-e /bin/bash &<br>
<br>
exec /usr/bin/xterm -name "xvnc" \<br>
-bg rgb:0/0/3fff \<br>
-fg rgb:ffff/ffff/ffff \<br>
-e ~/.scripts/StartVnc.sh &<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'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>