LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-15-2002, 12:58 AM   #1
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Moving up


Ok, so I am moving up from a newbie to a beginner.

When I first installed my distros, I chose to automatically startx when booting. Now I don't want to anymore, but I don't want to backup and reinstall everything. I also want to continue auto login but in console, not in X.

Can anyone tell me an easy way to stop starting X at boot, and to continue with the autologin? Thanks!

Oh, btw I am running Mandrake 8.2
 
Old 05-15-2002, 01:40 AM   #2
l_9_l
Member
 
Registered: Dec 2001
Location: New Zealand,Auckland
Distribution: debian
Posts: 86

Rep: Reputation: 15
1)to stop starting X at boot:
edit /etc/inittab
you will see someline like this "id:3:initdefault:"
may in your case it's 5,change it to 3

2)to autologin:
edit /etc/passwd
i will assume that masterc who needs to autologin..
you will see something like that:
masterc:x:1000:100:masterc:/home/masterc:/bin/bash
just erase the "x" in the second field,save the file and stay
you must be the root to do all these stuff.

more details:
man inittab passwd
 
Old 05-15-2002, 04:11 AM   #3
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
The second option won't automatically log you in. All it will do is remove the password. But why do you want to automatically login? If it's just a certain program you want to have running on startup then you should modify your /etc/inittab.

In my /etc/inittab I have the following lines:
1:2345:respawn:/sbin/agetty tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600

Those lines tell it to start 4 instances of agetty which wait for a login. Depending on what distribution you have you should have something similar. You can run man inittab to find out what they all mean. But if you want to have an extra program running on a terminal when you log in you could change the first line to something like:
1:2345:respawn:/usr/bin/consolemp3player < /dev/tty1 > /dev/tty1

Instead of having the login program running on the first tty1 you'll have an mp3player program running instead.
 
Old 05-15-2002, 05:13 AM   #4
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Original Poster
Rep: Reputation: 64
Yeah, it's so I can have mp3blaster running. I don't want to login or anything. I just want to be able to turn the power on, wait like 20 seconds (for everything to boot up and get started) and then press 1 or 2 keys to start playing music. I don't want to type whole commands or anything. Just "P" or whatever for Play, and "N" or whatever for next song. I am thinkin along the lines of the following:

When it boots (assuming an autoloin) all I press is the up arrow. This will invoke the last command executed. That command will be, "mp3blaster;shutdown -h now" That way once I end the mp3player program Linux will automatically power down. I have no monitor, that's why I want such simplicity. 1 key to start the player, 1 key to make it play, 1 key to go to next song, 1 key to shutdown the whole system.

Each time I boot the last command executed will be the same since I don't ever give it another command. So each time the arrow up key will invoke "mp3blaster;shutdown -h now" And then I can press F1 key to load my playlist, and "P" to play it.
 
Old 05-15-2002, 06:14 AM   #5
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
The whole autologin thing and then pressing the up key sounds like a bit of a weird workaround. Why don't you make a simple script something like:
Code:
#!/bin/bash
/usr/local/bin/mp3blaster
shutdown -h now
Then edit the /etc/inittab file and make an entry like:
1:2345:once:/usr/local/bin/mp3script </dev/tty1 >/dev/tty1

Make sure it replaces the other entry of what's running on tty1. I don't know exactly how mp3blaster works but I assume it's able to start playing songs when it starts up. That way you won't have to do anything except turn on the power and it will start playing by itself. No need to press up and then enter hoping that was the last command. The script you run makes sure that it calls the shutdown command after you close the mp3 player program.

Last edited by Mik; 05-15-2002 at 06:17 AM.
 
Old 05-15-2002, 06:25 AM   #6
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Original Poster
Rep: Reputation: 64
Sounds like a great idea, but it would be just as useful to me if it were written in Japanese. I really don't understand very much at all about scripts or anything command-line related. I am just moving into that part of the Linux thing.

Would I just open an editor, type that "code" and save the file? And then how do I execute the "code"?

Sorry, I am still on the newbie side of beginner.
 
Old 05-15-2002, 06:28 AM   #7
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Original Poster
Rep: Reputation: 64
Would this editing of tty1 thing also make it so I don't have to "autologin"?

Is there a short tutorial on advanced Console usage that I could go through so I am not so "slow" on here? Thanks.
 
Old 05-15-2002, 06:36 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,398

Rep: Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965
it's not like that.... by changing the inittab to run a mp3 player there IS not login to use in the first place. the applicatino will run instantly as root, and you will not have logged into use it. that file is loaded automatically on boot, and that is the file that creates the 6 login consoles. yeah? SO... if you change that first line the the default console will be REPLACED by an mp3 player. you would then still be able to use the other 5 terminals (Ctrl + Alt + F[ 2 to 6 ]
 
Old 05-15-2002, 06:40 AM   #9
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
Ok I'll see if I can explain it a bit better. tty's are virtual consoles usually in console mode you can use the ALT F1-F12 keys to switch between the virtual consoles. On a default setup the first 4 virtual terminals start a getty process which usually shows a little welcome screen and then waits for you to give your name and password so you can login. You don't want to be logging in all you want to do is have it start up the mp3 program right away. When you boot up it always starts on tty1 so you'll want to replace the entry for tty1 with the one for your mp3program. Since you want it to run several commands it's easiest to get it to run a script. A script is just a list of several commands in a row. You can create a script by just opening the file in a text editor. To get the script to run you will have to set the executable bit. Running 'chmod +x scriptfile' will set the executable bit.
By editing the /etc/inittab file you are telling the init process to start your script instead of waiting for a login on the first virtual terminal. So on bootup instead of asking for you to login it will just start the mp3 program. And because you told it to shutdown after calling the mp3 program, it will shutdown your computer after you close the mp3 program. I hope that explains it a little more clearly. I don't know about any advanced console tutorials. Maybe reading the howto's on www.linuxdoc.org will help you. I think there is one from bootup to bash prompt which might help.
 
Old 05-15-2002, 06:54 AM   #10
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Original Poster
Rep: Reputation: 64
Ahh(realizing), now it's in english, and I can see the translation. Thank you both. When I get home on Thur I will try it out and see how it goes and will let you know. thanks!
 
Old 06-06-2002, 05:51 AM   #11
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Original Poster
Rep: Reputation: 64
Ok sorry for bringing up a semi-old post, but I have another very related question...

So this is going great for me, with that script and stuff. But in order to load the songs I have to press F1 to switch to file mode. Then I have to select all the songs, so I press F2 Then I have to press F1 again to get to file play mode.

So I turn on my truck, turn on the MP3LinuxBox once it boots I press F1,F2,F1 and then the play button (the 5 key).

Is there a script or anything like that (say a macro or something) that I could run so that after I start the Box all I have to do is listen (meaning everything - F1,F2,F1,5 is already "entered")? And then I can just press the next key (6) to switch songs.

Thanks for any ideas, and again, I am sorry for bringing up an old post, as I know how much some of you hate it when I do that, not to mention any names (acid something). huh huh
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with moving to another hd jclu Linux - Hardware 0 11-30-2005 11:40 AM
moving along so far.... Tbagz Linux - Newbie 3 10-31-2005 05:20 AM
moving from one hd to another katy_c4c Linux - Newbie 3 10-22-2004 03:56 AM
copying/moving stalls when moving a lot of data to a usb stick =X= Linux - Hardware 10 07-30-2004 05:29 AM
moving from 2.4.xx to 2.6.3... Tih8710 Programming 2 06-21-2004 06:55 AM


All times are GMT -5. The time now is 11:39 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration