LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-04-2004, 09:35 PM   #1
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,091

Rep: Reputation: 41
script help?? want an option for init 3 or 4 on boot up??


I want an option of selecting init 3 or 4 on bootup. like a y/n prompt with a timeout... anyone know how to do this?? or can assist with this.

I would just leave it at init4 but once... (not having a boot disc) i changed some video options and X crashed and it just kept looping the error and never would take me to a command prompt.. this happened even reboot...

so if there is a way to get this option.. let me know.. if not. i will stick with telinit 3

thanks:trey
 
Old 01-04-2004, 10:20 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
The easiest way I would know of to do this is to do something like this:

Setup your machine to start in runlevel 3 as default by editing your /etc/inittab file or keeping it the same as how you already have it apparently.

Then create a file called .bash_login in your users /home directory, make sure it has the period in front like mentioned, its a hidden file, etc.

In this file add this which will basically be a prompt once a user logs in if they want to start up X or stay in the command line:

Code:
#!/bin/bash
# Script to ask user to start X at login or stay in the CLI.

echo -n "Would you like to start X (y or n)? "
    read INPUT
      if [ "$INPUT" = "y" ]; then
      startx
        else
        echo "You selected not to start X, if at anytime you want to start X, simply type startx"
      fi
I haven't tested this but this should work AFAIK. You can however simply put 'startx' in the .bash_login file and once you login, it will automatically startx, if it fails, it will just throw you back into the command line instead of attempting to loop like runlevel 4 will do to ya.

Cheers and hope this is what you were looking for.
 
  


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
Kernal Panic: No init found. Try passing init= option to kernel raees Linux - General 12 03-18-2004 11:10 PM
Kernel Panic: No Init Found Try Passing Init=option To Kernel Bakame Linux - Newbie 4 03-10-2004 06:08 AM
error: No init found. Try passing the init= option to the Kernel neylitalo Linux - Laptop and Netbook 3 01-22-2004 09:34 PM
error "Kernel panic: No init found. Try passing init= option Anauj0101 Linux - Newbie 3 05-06-2003 10:18 PM
Compiled own kernel and got: Kernel panic: No init found. Try passing init= option to fbl Linux - General 12 01-14-2003 03:38 AM

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

All times are GMT -5. The time now is 05:31 PM.

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