Mailing List Archive

Autostarting under RH9 and KDE
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.

-Jeff
Re: Autostarting under RH9 and KDE [ In reply to ]
> 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
Re: Autostarting under RH9 and KDE [ In reply to ]
On Thu, 2003-05-29 at 14:41, Poul Petersen wrote:
> #1:2345:respawn:/sbin/mingetty tty1
> 1:2345:respawn:/usr/bin/openvt -f -c 1 -w -- /bin/login -f mythtv

I used these lines in /etc/inittab:

1:235:respawn:/sbin/mingetty tty1
myth:4:respawn:/usr/bin/openvt -f -c 1 -w -- /bin/login -f mythtv

That way, I can change the default run-level and get a normal
workstation again. You didn't say that you disabled starting X in
run-level 5 (which would be the default) but I assume you did that.
With the above set up, you need to make sure everything you need for
mythtv to work is started in run-level 4.

> 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

I used the above more or less verbatim!

> 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 used this as the .xinitrc for the mythtv user:

xset -dpms s off
irxevent &
blackbox &
sleep 2 # probably not necessery
exec mythfrontend

(Note: I'm using blackbox here, but you could substitute any simple
window manager you'd like to try in the above file.)

> -poul

Thanks Poul, without your post I'd probably still me fiddling with this.

Regards,
Aran