run levels

skeletal29

Senior member
Oct 2, 2001
274
0
0
How can i change the run level? and how can i change what runs in a run level.Like httpd and stuff like that?
Is there a manual?

Thanks,
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
The files for each runlevel are in /etc/rc.Xd, where X s the number of the runlevel you want.
Each file is a symlink to the real script in /etc/init.d preceded by S for start or K for kill and a number for ordering.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Something Im not sure about the sysv init structure is that if I boot into run level 3, will the run level 2 startup scripts be run also?
 

Armitage

Banned
Feb 23, 2001
8,086
0
0


<< How can i change the run level? and how can i change what runs in a run level.Like httpd and stuff like that?
Is there a manual?

Thanks,
>>



To switch runlevels use the telinit command. For more info, see the man page and some of the other man pages referenced by it (inittab, runlevel, initscript, etc.)
Many distributions also have a runlevel editor that you can use if you don't want to muck with the scripts directly. RedHat's chkconfig is pretty nice.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
if I boot into run level 3, will the run level 2 startup scripts be run also?

No.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0


<< if I boot into run level 3, will the run level 2 startup scripts be run also?

No.
>>



Thanks.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Too expand a little bit more, some distros like Debian have scripts that always run no matter what run level you enter, Debian's are in /etc/rcS.d.
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
i have a quick question, runlevel 5 is multiuser with X and networking, blah blah. but if i boot into runlevel 2 and then startx, does it put me into runlevel 5?

another quickie: what is the "right" way to make something start up at boot? before, i just added little scripts to /etc/rcX.d, but now in this thread i have learned that the correct way to do it would be to put it into /etc/init.d and add a symlink to it in rcX.d and then the S stands for start and the number is the order to start it in. now i finally know what the S20 and S44 and whatnot stand for

i've heard people talk about a file called rc.local. i dont have this file, nor a man page for it, what is it?

just want to get this straightened out. not quite as clear cut as autoexec.bat or windows startup folder or "Run" key in the registry.

thanks.

edit: this is debian
 
Sep 3, 2001
131
0
0


<< i have a quick question, runlevel 5 is multiuser with X and networking, blah blah. but if i boot into runlevel 2 and then startx, does it put me into runlevel 5? >>



No.



<< another quickie: what is the "right" way to make something start up at boot? >>



Not really a correct way to answer that, as it depends on what it is you're starting at boot. Services should usually have their own script in /etc/rc.d/init.d/ (in Redhat, Mandrake, etc) or /etc/init.d/ (Debian), utilities such as hdparm, and things of that sort can be started from rc.local.



<< i've heard people talk about a file called rc.local. i dont have this file, nor a man page for it, what is it? >>



Its a script in /etc/init.d thats symlinked in the runlevel directories usually as S99 (so it starts last).
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0


<<

<< i have a quick question, runlevel 5 is multiuser with X and networking, blah blah. but if i boot into runlevel 2 and then startx, does it put me into runlevel 5? >>



No.



<< another quickie: what is the "right" way to make something start up at boot? >>



Not really a correct way to answer that, as it depends on what it is you're starting at boot. Services should usually have their own script in /etc/rc.d/ or /etc/init.d/ in sysv init, other utilities such as hdparm and things of that sort should probably be started from rc.local.



<< i've heard people talk about a file called rc.local. i dont have this file, nor a man page for it, what is it? >>



Its a script in /etc/rc.d/ thats symlinked in the runlevel directories usually as S99 (so it starts last).
>>


thanks for answering those, the only small caveat is that i dont have an /etc/rc.d, nor an rc.local anywhere on my system.

so basically services are in rcX.d/ and programs go in rc.local.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
thanks for answering those, the only small caveat is that i dont have an /etc/rc.d, nor an rc.local anywhere on my system.

/etc/rc.d was a RedHat-ism, they've since switched to /etc/init.d and /etc/rcX.d wth symlinks for backwards compatibility.

Debian doesn't use rc.local, they give you a skeleton service script (/etc/init.d/skeleton) to copy and edt for any services you need at boot up.

so basically services are in rcX.d/ and programs go in rc.local.

the rcX.d scripts are just shell scripts, you can have them do anything you want which include starting daemons which is their most common use. Debian has /etc/init.d/bootmisc.sh which does a lot of bootup 'cleanup' work, but starts no daemons.

The Debian docs for init scripts are here.
 

skeletal29

Senior member
Oct 2, 2001
274
0
0
thanks guys.....i just started to use redhat as a web,ftp, adn telnet (soon changin to sshd) server and its gr8 but i am not totally able to run everything from command line(well i dont know exactly wher all the config files are and stuff the x makes it much more easier)
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |