[mythtv-users] My auto start with Mandrake 9.1

Adrian Burden aburden at onegeeksopinion.com
Mon Jun 2 23:36:38 EDT 2003


I hacked a script together to get Mythtv to auto start and autologin
with FVWM2, the startup services from
http://www.mythtv.org/docs/mythtv-HOWTO-19.html#ss19.12"> and
http://www.mythtv.org/docs/mythtv-HOWTO-19.html#ss19.2">.

I was not happy with the KDE autologin and wanted to use a light weight
windows manager. I found an article in the archives
http://www.gossamer-threads.com/perl/mailarc/gforum.cgi?post=63808;searc
h_string=auto%20start;guest=561358&t=search_engine#63808"> but I could
not get the openvt to auto login on Mandrake 9.1. I did some googling
and found an article at http://www.lawlug.com/kiosk.php LawLUG that
almost worked. I put the two together and got this.

Using your favorite text editor create a file named autologinmythtv.c
and type in this short C program:

int main() {
execlp( "login", "login", "-f", "mythtv", 0);
}
* I uses mythtv as the user on my system *

The execlp system call invokes the command "login -f mythtv" and
replaces the current processing context with this invocation. The man
page for login describes the action of the -f argument. Compile this
tiny C program using the GNU C-compiler:

$ gcc -o autologinmythtv autologinmythtv.c

Gain root privileges (using su) and copy the executable to
/usr/local/bin:

# cp autologinmythtv /usr/local/bin/

Here is the script to add to the user mythtv's .bash_profile in 
/home/mythtv/.bash_profile

if [ -z "$DISPLAY" ] && [ $(tty) == /dev/vc/1 ]
then
    while [ 1 ]; do
         startx
         sleep 5
    done
fi

This basically checks to make sure it is ok to start X by checking you
are local and on the first virtual console.
This allows us to still log in on other terminals and remote in without
X getting in the way. Next we create and endless loop that starts X and
mythfrontend with the FVWM config files xinitrc and fvwmrc. Then if myth
crashes or you need to reset, just ALT-CTRL-Backspace and X will restart
after 5 seconds. This way my Wife does not have to login and mess on the
command line to get MythTV going when I am not around.

Now the system will start, 
load up mythbackend, 
start lircd from rc.local, 
autologin user mythtv
start X and load mythfrontend.

Hope this helps someone out there. 

Cheers...




More information about the mythtv-users mailing list