LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-04-2003, 09:53 PM   #1
rrautens
LQ Newbie
 
Registered: Sep 2003
Location: Buffalo, NY
Distribution: FC6, Slackware 10.2
Posts: 8

Rep: Reputation: 0
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

Thanks!

Rob
 
Old 10-05-2003, 11:00 PM   #2
rahulsundaram
Member
 
Registered: May 2003
Location: India
Distribution: Knoppix, RedHat
Posts: 246

Rep: Reputation: 30
hi

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

regards
rahul sundaram
 
Old 10-06-2003, 07:10 AM   #3
rrautens
LQ Newbie
 
Registered: Sep 2003
Location: Buffalo, NY
Distribution: FC6, Slackware 10.2
Posts: 8

Original Poster
Rep: Reputation: 0
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?

Thanks,
 
Old 10-06-2003, 08:50 AM   #4
fatgod
Member
 
Registered: Mar 2002
Location: Edinburgh, Scotland
Distribution: Suse 7.2, Gentoo 1.4, Solaris 9
Posts: 661

Rep: Reputation: 30
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
 
Old 10-06-2003, 12:16 PM   #5
rahulsundaram
Member
 
Registered: May 2003
Location: India
Distribution: Knoppix, RedHat
Posts: 246

Rep: Reputation: 30
hi

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

regards
rahul sundaram
 
Old 10-06-2003, 02:31 PM   #6
rrautens
LQ Newbie
 
Registered: Sep 2003
Location: Buffalo, NY
Distribution: FC6, Slackware 10.2
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 10-06-2003, 02:31 PM   #7
Megamieuwsel
Member
 
Registered: Sep 2002
Location: Haarlem , the Netherlands
Distribution: VectorLinux SOHO 5.1
Posts: 470

Rep: Reputation: 35
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.
 
Old 10-06-2003, 04:22 PM   #8
fatgod
Member
 
Registered: Mar 2002
Location: Edinburgh, Scotland
Distribution: Suse 7.2, Gentoo 1.4, Solaris 9
Posts: 661

Rep: Reputation: 30
Dude,

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'" \

exit



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

Last edited by fatgod; 10-06-2003 at 04:25 PM.
 
Old 10-06-2003, 06:04 PM   #9
euangray
LQ Newbie
 
Registered: Sep 2003
Location: UK
Distribution: LFS-CVS-20031113
Posts: 29

Rep: Reputation: 15
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.

Euan
 
Old 10-06-2003, 08:51 PM   #10
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
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:
Code:
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.

Last edited by /bin/bash; 10-06-2003 at 08:53 PM.
 
Old 10-15-2003, 09:30 AM   #11
rrautens
LQ Newbie
 
Registered: Sep 2003
Location: Buffalo, NY
Distribution: FC6, Slackware 10.2
Posts: 8

Original Poster
Rep: Reputation: 0
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
auto login as root (or other user) in console mode Peter_Peck Linux - General 4 05-01-2009 02:05 AM
adminstrator login while auto-login is on? joshknape Linux - General 5 07-19-2005 04:51 AM
Auto-logout on console switch cjpsparks Linux - General 2 11-20-2003 02:54 AM
Auto-login and auto-restart... TankerKevo Red Hat 2 10-04-2003 07:52 AM
auto url parsing on console bluecadet Linux - General 1 12-18-2001 04:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration