Re: howto do automatic login to runlevel 3?
- From: "J.O. Aho" <user@xxxxxxxxxxx>
- Date: Mon, 04 Sep 2006 19:11:58 +0200
Eric wrote:
Eric wrote:
I'm doing some special testing - i need to have the system boot and
automatically login to run level 3 (not 5) and execute a program. The
system is on a small isolated local network and will need network
communications to 3 other machines, so init 1 is out
so - how do i do automatic root login at runlevel 3? and where do i put a
call to my test program to auto-start it
Thanks
Eric
Well, here's the problem. I'm finding that there are differences if i run a
program from S99local as compared to logging in as root and then running
it. for example - the path isnt set. Also, i get random Hangup messages
from the shell during my program if i run it from S99local - i dont see
those when running after i login. Perhaps i need to source root's .bashrc
and a few other files?
It should be enough to source the /root/.bashrc
another way could be to compile this small program
--- autorootlogin.c ---
int main() {
execlp( "login", "login", "-f", "root", 0);
}
--- eof ---
Then edit your /etc/inittab ans select on which virtual terminal you want the root to be logged in, say you want to it be vt6, then change the line:
c6:12345:respawn:/sbin/agetty 38400 tty6 linux
to look like:
c6:12345:respawn:/root/autorootlogin
Now edit your /root/.bashrc to execute the program you want to run.
This isn't anything I would recommend you to do, as you will get trouble when you login as root for other reasons or use su. This can be useful if you want to run something as unprivileged user, like mythtv/freevo, just switch the "root" to the username you want to login as in the small c program.
//Aho
.
- Follow-Ups:
- Re: howto do automatic login to runlevel 3?
- From: Lawrence D'Oliveiro
- Re: howto do automatic login to runlevel 3?
- References:
- Re: howto do automatic login to runlevel 3?
- From: Eric
- Re: howto do automatic login to runlevel 3?
- Prev by Date: Re: howto do automatic login to runlevel 3?
- Next by Date: Re: Swap
- Previous by thread: Re: howto do automatic login to runlevel 3?
- Next by thread: Re: howto do automatic login to runlevel 3?
- Index(es):
Relevant Pages
|
|