-   Linux - Newbie (
-   -   Is it possible to auto login from console (

rrautens 10-04-2003 09:53 PM

Is it possible to auto login from console
Hi everyone,

Pardon me if the subject is using the wrong terminology (that's why I'm posting in the newbie forum!). Anyway, I'm trying to set up my freevo to run automatically upon boot up, but it starts my script, then stops and shows the console (tty) login prompt. Anyone know how to make it login automatically, or am I going down the wrong path? I'm using Anand Patel's guide for booting freevo, but it doesn't seem to work. Any help would be greatly appreciated. Oh yeah, I'm running Red Hat 9, using runlevel 4 and not running gdm, I'm using the following line to start X:

/usr/X11R6/bin/xinit /root/freevo.xinitrc -- /usr/X11R6/bin/X -xf86config /etc/X11/XF86Config bc



rahulsundaram 10-05-2003 11:00 PM


i dont know what freevo is but if its a service you should be running it at runlevel 3 for command prompt and runlevel 5 for graphical. search in google. i am not sure howto set this up

rahul sundaram

rrautens 10-06-2003 07:10 AM

Hi Rahul,

Freevo is a DVR application. What I am looking to do is turn my Red Hat 9 system into an appliance. I would like the system to boot up and run Freevo without logging in, or boot up, log in automatically. Right now, I'm using runlevel 4 for a custom boot config. Have you ever heard of anyone being able to auto-login?


fatgod 10-06-2003 08:50 AM

Are you sure that you need to login? Can you not just setup an RC script to run Freeco at boot?

I have no idea about Freevo, so I am just asking ;)

rahulsundaram 10-06-2003 12:16 PM


ok then. runlevel 4 makes better sense now. like the post above i believe that you can run this as a service without actually logging in. sorry. cant help better than that

rahul sundaram

rrautens 10-06-2003 02:31 PM

Hi fatgod,

I do have it running as an rc script. the script runs, looks like it is about to start and then it goes to the login prompt. If I log in and run the same script, it works...

It's got me totally confused.

Megamieuwsel 10-06-2003 02:31 PM

Dunno 'bout RedHat , but in SuSE , somewhere in the Acount-management-configuration-thingy , you could set up a default user and make it login automatically.
Maybe you should look for something like that in RH.

fatgod 10-06-2003 04:22 PM


I think you might be able to use "expect" to get your script to login for you. Expect is a command interpreter that is meant to be used for this very purpose. I beleive that you can also use it in a regular bash script to attain the same results.

Ummm, I think that something like this would work, albeit in a very crap way....

#! /bin/bash

#yada yada yada, all your regular script upto this point, but when the
# script wants to start a login you need to get funky ;)
#I've no idea what your RC script is doing, but for ssh you might do
# somthing like this...

expect -c "spawn /usr/bin/ssh mycomputer"\
-c "expect password: " \
-c "send mypassword\r" \
-c "system 'MyFreevocommand'" \


This way probably completely sucks and will barely work ;) I dont use expect in this fashion, but I know that you can. Expect is a massive program, and the man page wont be much help to you, but you can also use expect to execute bash commands so maybe you should use it that way instead.

I dont really know... maybe posting the script your running Freevo from might help...

[EDIT]: Actually I'm not sure if 'system' it the right command, post your script though and we will see what we can do ;)

euangray 10-06-2003 06:04 PM

You can in principle start a Linux system without logging in, by setting the default runlevel to 1 in /etc/inittab - but (a) you won't get network access and (b) not all distributions support doing this (they shouldn't - it's basically a single user system maintenance mode).

If your program can run as a daemon ("service" in Windows-speak) then you could configure it thus, in which case it can autorun on system boot. I don't know about your program (never even heard of it), but that's the general principle. Check out the docs for your program.

Dunno if that helps.


/bin/bash 10-06-2003 08:51 PM

Put it in /etc/inittab where the runlevels are defined, every distro is different but RedHat should be something like this:

# Script to run when going to other runlevel:

si::sysinit:/etc/rc.d/rc.sysinit  # System initialization (runs when system boots).
l0:0:wait:/etc/rc.d/rc 0        # Halt the system
l1:1:wait:/etc/rc.d/rc 1        # Single user
l2:2:wait:/etc/rc.d/rc 2        #
l3:3:wait:/etc/rc.d/rc 3        # Default
l4:4:wait:/usr/X11R6/bin/xinit /root/freevo.xinitrc -- /usr/X11R6/bin/X -xf86config /etc/X11/XF86Config bc      # 
l5:5:wait:/etc/rc.d/rc 5        # X window and xdm
l6:6:wait:/etc/rc.d/rc 6        # Reboot the system

Now I don't know if you can pass arguments like that so you may need to create a script that passes the arguments to freevo

Then you just change the initdefault line to 4 in inittab.

rrautens 10-15-2003 09:30 AM

Got it to work -- albeit in a cheesy way. I did the following:

Set gnome to autologin with an account, then in gnome i set freevo to start. It's not exactly what I was hoping for, but it'll do. Thanks for all your help!

All times are GMT -5. The time now is 02:16 AM.