[mythtv-users] Auto-start mythfrontend

Stephen L. Ulmer ulmer at ulmer.org
Wed Jan 7 22:36:38 EST 2004


On 6 Jan 2004, pc-mythtv at crowcastle.net said:
> What's the right way to auto-start mythfrontend at boot time?
>
> Ideally, it would restart X if X dies, and it would restart
> mythfrontend if it dies.  (Then I could hit ctrl-alt-backspace to
> reset it if things go really haywire.)
>
> I'm thinking of playing with the xdm scripts, but I expect there's
> already a good solution (or several).  (And if there's a good
> solution that everyone likes, it would be nice to have it in the
> documentation--please point me at it if I simply missed it.)
>
> (I'm running Gentoo, but I don't mind adapting scripts if something
> works well on another system.)

You have described almost perfectly what /etc/inittab is for. Write a
script and use a "respawn" line. For Gentoo, as long as you start it
after the "default" runlevel you should be fine.

I've attached the file that I use to start my frontend (and some other
cruft).  This is actually my /etc/conf.d/local.start, but probably
addresses most pitfalls you'll run across trying to autostart.

You probably don't need to run XDM unless you actually *want* a
display manager. (You want to do XDMCP queries to it or something.)

-- 
Stephen

-------------- next part --------------
# /etc/conf.d/local.start:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/local.start,v 1.4 2002/11/18 19:39:22 azarah Exp $

##
## /etc/init.d/autofs doesn't understand how to parse LDAP
## entries in auto.master.  Start each direct map here.
##
automount /misc ldap 192.168.1.11:ou=auto.misc,ou=Services,dc=ulmer,dc=org
automount /u    ldap 192.168.1.11:ou=auto.u,ou=Services,dc=ulmer,dc=org

##
## /etc/init.d/alsasound normally saves/restores settings. It's part of
## alsa-driver, which doesn't seem to emerge properly on 2.6.0-testX.
##
## Restore sound settings, including SPDIF on.
##
#alsactl restore
modprobe snd-pcm-oss
modprobe snd-mixer-oss

##
## Whacked out lirc drivers, lircd doesn't understand devfs, and there's
## no conf.d to pass it config entries. (NB: using kernel modules from
## a completely different version of lirc, but daemon from the emerged one).
##
/usr/sbin/lircd -d /dev/lirc/0

##
## Start an X server on the console
##
/usr/bin/X11/X -once &
export DISPLAY=":0"
sleep 5

##
## Start a window manager (lest we can't switch focus so 
## mplayer can get keyboard
##
/usr/bin/lwm &

##
## Start MythTV front-end
##
mythfrontend >> /var/log/mythtv/mythfrontend.log 2>&1 &

##
## This sends keypresses to non-MythTV programs (part of lirc)
##
irxevent /etc/mythtv/lircrc &

##
## Turn off the X11 screen saver
##
/usr/bin/X11/xset -dpms s off

##
## mythdvd transcode daemon
##
/usr/bin/mtd &



More information about the mythtv-users mailing list