[mythtv-users] Auto login as user and start Myth.

Robin Gilks g8ecj at gilks.org
Mon Nov 28 19:06:11 EST 2005


> This is probably easy, but I can't think of an obvious way to
> automatically
> login as a user.  From that point you need to start X and mythfrontend,
> but
> that is probably easy as long as one can figure out how to execute a
> script
> as a particular user.
>
> The overall idea is to have the system get to the point that you can use
> the
> remote automatically after you turn it on.  I'm using Gentoo Linux.  This
> shouldn't be that hard, but I just don't see an obvious starting point
> other
> than maybe figuring out the init process from inittab or maybe something
> like
> xdm that does autologins.
>

I'm running gentoo on a keyboardless/mouseless box so this is what I came
up with.

If not already using it, emerge mingetty and put the following into
/etc/inittab - this will log you in as the mythtv user:
c7:12345:respawn:/sbin/mingetty --autologin=mythtv tty7

Next, make sure that you have a home directory for the mythtv user in
/etc/passwd:
mythtv:x:1000:100::/home/mythtv:/bin/bash

In that home directory, create a .bash_profile file like this - this
starts up X only if running on vertual terminal 7, so if you telnet or ssh
into the box it doesn't throw a wobbly. It also restarts X if the frontend
crashes:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty7 ]; then
  while [ 1 == 1 ]
  do
    startx
    sleep 10
  done
fi

The next step is to get X to start up a window manager and the mythtv
frontend. This is done in .xinitrc which should contain something like
this. Note that by uncommenting a line or two I can also run up the setup
or an xterm:
xset -dpms s off
xsetroot -solid black
x11vnc -many -q -bg -rfbauth .vnc/passwd
fvwm2 &
mythfrontend > /home/mythtv/mythfrontend.log 2>&1
#mythtv-setup
#xterm

Finally, a bit of fine tuning of the window manager (fvwm2 in my case but
other lightweight ones could be used). This is my .fvwm2rc file:
# Submitted by Scott Elliott <selliott at insight.rr.com>
Style "*"       RandomPlacement, DumbPlacement
Style myth*     NoTitle, NoHandles, Sticky, WindowListSkip, SloppyFocus,
GrabFocus, BorderWidth 0
Style xmame*    NoTitle, NoHandles, Sticky, WindowListSkip, SloppyFocus,
GrabFocus, BorderWidth 0, StaysOnTop
Style mplayer*  NoTitle, NoHandles, Sticky, WindowListSkip, SloppyFocus,
GrabFocus, BorderWidth 0


Enjoy...

-- 
Robin Gilks







More information about the mythtv-users mailing list