[mythtv-users] Autostarting under RH9 and KDE

Poul Petersen petersp at MATH.ORST.EDU
Thu May 29 20:41:48 EDT 2003


> I believe I managed to fail to mention that I was running KDE under RH9 on 
> my last message, a request for some detailed instructions on creating and 
> placing the necessary files for having myth and irexec autostarting on 
> reboot.  Sorry about that - too deep in to the issue sometimes...
> 
> If someone has this working and can share their details on or off list I 
> don't mind doing up a more formal doc and posting it as well.

	I recently started working on a mythtv box and I an currently
using RH9 and KDE. Your request is fairly broad, but I'll touch on the
elements that I remember and maybe that will help even if non
comprehensive. Note that I am not using irexec at this time. For
starting mythbackend as well as some other stuff, I have the following
in /etc/rc.local:

# Force btaudio to load
modprobe btaudio

# Fire up the myth backend
export QTDIR=/usr/lib/qt-3.1 && /usr/local/bin/mythbackend > /var/log/mythbackend.log 2>&1 &

# Provide normal user access to hardware screen resizing
/usr/sbin/nvtvd > /dev/null 2>&1 &

	KDE has an auto-login feature, but I was playing with different
window managers so I decided not to use this. Instead, I run mythtv with
a user named "mythtv", imagine that :) In order to get this user logged
in on boot, I changed the following line in /etc/inittab:

#1:2345:respawn:/sbin/mingetty tty1
1:2345:respawn:/usr/bin/openvt -f -c 1 -w -- /bin/login -f mythtv

	This causes the virtual terminal on tty1 to auto-logon to the 
mythtv account. Notice that the mythtv user therefore does not even need
to have a valid password. I then placed a short routine in the mythtv
user's .bash_profile:


export PATH=$PATH:/usr/local/mythtv/bin:/usr/lib/qt-3.1/bin
export QTDIR=/usr/lib/qt-3.1

/usr/bin/aumix -L

if [ "z`ps -aef |grep X | grep -v grep`" = "z" ]; then

  while [ 1 ]; do
    startx
    sleep 5
  done
fi

	Obviously the aumix line restores the mixer settings. The "if"
construct avoid starting X twice if I su to the mythtv user. The while
loop causes X to restart if it should die - this is handy when I forget
for example that PIP isn't working yet because I'm still using a non
full-duplex sound driver and so I can Ctrl-Alt-Backspace to kill X and
it will start back up. The 5 second pause is so I can break out of the
loop if I really want to drop tty1 to a terminal session.

	In order to get mythfrontend to startup automatically, I placed
the following code in "~mythtv/.kde/Autostart/myth"

#!/bin/sh
xset -dpms s off
exec /usr/local/bin/mythfrontend

	I tried using a soft-link, but for some reason this caused two 
instances of mythfrontend to startup. The xset shuts off the DPMS screen
blank, though I also had to disable the KDE screen blank.

	So that's how I did it. Now if I could just get alsa working
with the on-board sound on my Asus A7V8X-X, grrrrr...

-poul


More information about the mythtv-users mailing list