LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-14-2005, 04:41 PM   #1
sebastian.raghe
LQ Newbie
 
Registered: Apr 2005
Location: Grimsby, Canada
Distribution: Debian (etc)
Posts: 4

Rep: Reputation: 0
runlevel shell scripts


i'm working on a little project with some friends where we are creating an arcade mechine with games we have designed ourselves, and we want to be able to boot our instillation directly into the program we have written to select the games. we're all a bunch of linux newbies so we're very lost.

the solution we think might be best:

because the default run level fopr debian is 2 we figured we can go into rc2.d make a link to a shell in init.d that runs our java gui instead of loading gdm. but we have no idea how to do this. we've only heard scraps about how it can be done. please i'll accept any sort of help including on-line manuals.

thanks all of you for reading the post and for your help in advance.

Last edited by sebastian.raghe; 04-14-2005 at 04:43 PM.
 
Old 04-14-2005, 05:53 PM   #2
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
You got it right on the ball. That's how you create startup scripts. So, create your script in /etc/init.d/my_start_script_goes_here. Next, create a sym link to it. This is how:

ln -s /etc/init.d/my_start_script_goes_here /etc/rc2.d/S98my_start_script_goes_here.

Obviously, you can change mystartscript to whatever name you choose.

-twantrd
 
Old 04-15-2005, 02:03 AM   #3
short101
Member
 
Registered: May 2004
Location: Aust.
Distribution: Debian
Posts: 424

Rep: Reputation: 30
Have a read of 'man update-rc.d' it explains it all pretty well
 
Old 04-15-2005, 08:14 AM   #4
sebastian.raghe
LQ Newbie
 
Registered: Apr 2005
Location: Grimsby, Canada
Distribution: Debian (etc)
Posts: 4

Original Poster
Rep: Reputation: 0
thanks for the confirmation. now my follow up question.

how do i activate a java program via this shell script? we want to skip loading gdm and just have out java program run after the mechine boots. whats a good doc i can use to figure out how to run it? just a small tutorial or a bit of assistance would be greatly appreciated.
 
Old 04-15-2005, 02:26 PM   #5
zuralin
Member
 
Registered: Sep 2003
Distribution: Debian testing/unstable
Posts: 229

Rep: Reputation: 32
You never mentioned if your java program required the use of X (which would be helpful next time) so I will give you both ways (with and without X) to get your computer to boot straight into your java program. I do the same thing for my mythtv box.

First you want to login as normal user so your program isn't running as root. To automate this you need to:
apt-get install mingetty
vim /etc/inittab

Find the line:
1:2345:respawn:/sbin/getty 38400 tty1

And replace it with:
1:2345:respawn:/sbin/mingetty -l USERNAME tty1
(replace USERNAME with the user want to be logged in as)

Now everytime your computer boots you will be logged in as USERNAME.

If you need X to start up place the following in your ~/.profile: (if it doesn't exist create it)
Code:
if [ -z "$DISPLAY" ] && [ `tty` == /dev/tty1 ]; then
  startx
fi
Otherwise place the line to run your java program in that file.

If X is being started then you need to edit your ~/.xinitrc and place the line to start your java program in that file. Now whenever you boot up you should be logged in with your java program running. HTH
 
  


Reply



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
Runlevel start/stop scripts vanalex Linux - General 0 01-27-2004 08:54 PM
Slack; Where are the runlevel scripts? GAVollink Slackware 4 11-10-2003 09:21 AM
shell scripts... roofy Linux - Newbie 13 05-06-2003 06:06 PM
Shell scripts anon227 Linux - Software 1 01-03-2003 03:11 PM
shell scripts nautilus_1987 Linux - General 3 08-30-2002 03:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:48 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