MESSAGE
DATE | 2002-10-12 |
FROM | Ruben I Safir
|
SUBJECT | Subject: [hangout] Re: [nylug-talk] INIT problem
|
You do realize what a run level is?
We teach this in the GNU/Linux One class of the FSI.
Look at /etc/inittab file. After the Kernel starts, it reads this file and decides what run level to start in. My file looks like this:
# The default runlevel is defined here id:3:initdefault:
# First script to be executed, if not booting in emergency (-b) mode si:I:bootwait:/etc/init.d/boot
# /etc/init.d/rc takes care of runlevel handling # # runlevel 0 is System halt (Do not use this for initdefault!) # runlevel 1 is Single user mode # runlevel 2 is Local multiuser without remote network (e.g. NFS) # runlevel 3 is Full multiuser with network # runlevel 4 is Not used # runlevel 5 is Full multiuser with network and xdm # runlevel 6 is System reboot (Do not use this for initdefault!) # l0:0:wait:/etc/init.d/rc 0 l1:1:wait:/etc/init.d/rc 1 l2:2:wait:/etc/init.d/rc 2 l3:3:wait:/etc/init.d/rc 3 #l4:4:wait:/etc/init.d/rc 4 l5:5:wait:/etc/init.d/rc 5 l6:6:wait:/etc/init.d/rc 6
# what to do in single-user mode ls:S:wait:/etc/init.d/rc S ~~:S:respawn:/sbin/sulogin
# what to do when CTRL-ALT-DEL is pressed ca::ctrlaltdel:/sbin/shutdown -r -t 4 now
# special keyboard request (Alt-UpArrow) # look into the kbd-0.90 docs for this kb::kbrequest:/bin/echo "Keyboard Request -- edit /etc/inittab to let this work."
# what to do when power fails/returns pf::powerwait:/etc/init.d/powerfail start pn::powerfailnow:/etc/init.d/powerfail now #pn::powerfail:/etc/init.d/powerfail now po::powerokwait:/etc/init.d/powerfail stop
# for ARGO UPS sh:12345:powerfail:/sbin/shutdown -h now THE POWER IS FAILING
# getty-programs for the normal runlevels # ::: # The "id" field MUST be the same as the last # characters of the device (after "tty"). 1:2345:respawn:/sbin/mingetty --noclear tty1 2:2345:respawn:/sbin/mingetty tty2 3:2345:respawn:/sbin/mingetty tty3 4:2345:respawn:/sbin/mingetty tty4 5:2345:respawn:/sbin/mingetty tty5 6:2345:respawn:/sbin/mingetty tty6
This file defines the programs to kick off at what run level and how to hand out terminal, and over what devices.
So at run level 5, minigetty respawns and listens on tty 1-6 fr logins.
It also kicks off the scripts in /etc/init.d/rc.5/
This directory has the following files which are examined and used at runtime:
ruben-at-www2:~> ls -al /etc/init.d/rc5.d/ total 9 drwxr-xr-x 2 root root 1736 Aug 20 17:51 . drwxr-xr-x 12 root root 3936 Oct 10 00:12 .. lrwxrwxrwx 1 root root 26 May 22 15:26 K02personal-firewall.final -> ../personal-firewall.final lrwxrwxrwx 1 root root 14 May 22 14:28 K02splash_late -> ../splash_late lrwxrwxrwx 1 root root 8 Jun 1 20:47 K04inetd -> ../inetd lrwxrwxrwx 1 root root 8 Jun 1 16:22 K06route -> ../route lrwxrwxrwx 1 root root 7 May 22 16:05 K12cron -> ../cron lrwxrwxrwx 1 root root 7 May 22 16:05 K12nscd -> ../nscd lrwxrwxrwx 1 root root 9 Aug 20 17:51 K12smpppd -> ../smpppd lrwxrwxrwx 1 root root 8 May 22 15:26 K13smbfs -> ../smbfs lrwxrwxrwx 1 root root 9 May 22 15:26 K13splash -> ../splash lrwxrwxrwx 1 root root 6 May 22 15:26 K13xdm -> ../xdm lrwxrwxrwx 1 root root 12 May 22 15:26 K14alsasound -> ../alsasound lrwxrwxrwx 1 root root 6 May 22 15:26 K14atd -> ../atd lrwxrwxrwx 1 root root 8 May 22 15:26 K14fbset -> ../fbset lrwxrwxrwx 1 root root 6 Jun 23 03:22 K14lpd -> ../lpd lrwxrwxrwx 1 root root 11 May 22 15:26 K14sendmail -> ../sendmail lrwxrwxrwx 1 root root 6 May 22 15:26 K15nfs -> ../nfs lrwxrwxrwx 1 root root 9 May 22 15:26 K16hwscan -> ../hwscan lrwxrwxrwx 1 root root 10 Jun 23 03:50 K16portmap -> ../portmap lrwxrwxrwx 1 root root 15 May 22 15:26 K16splash_early -> ../splash_early lrwxrwxrwx 1 root root 7 May 22 15:26 K16sshd -> ../sshd lrwxrwxrwx 1 root root 10 May 22 15:26 K17hotplug -> ../hotplug lrwxrwxrwx 1 root root 10 May 22 15:33 K18bayonne -> ../bayonne lrwxrwxrwx 1 root root 9 May 22 15:26 K18syslog -> ../syslog lrwxrwxrwx 1 root root 10 May 22 15:26 K19network -> ../network lrwxrwxrwx 1 root root 7 May 22 15:26 K23isdn -> ../isdn lrwxrwxrwx 1 root root 28 May 22 15:26 K23personal-firewall.initial -> ../personal-firewall.initial lrwxrwxrwx 1 root root 9 May 22 15:26 K23random -> ../random lrwxrwxrwx 1 root root 7 May 22 14:15 S01isdn -> ../isdn lrwxrwxrwx 1 root root 28 May 22 14:16 S01personal-firewall.initial -> ../personal-firewall.initial lrwxrwxrwx 1 root root 9 May 22 14:07 S01random -> ../random lrwxrwxrwx 1 root root 10 May 22 14:08 S05network -> ../network lrwxrwxrwx 1 root root 10 May 22 15:33 S06bayonne -> ../bayonne lrwxrwxrwx 1 root root 8 Jun 1 16:21 S06route -> ../route lrwxrwxrwx 1 root root 9 May 22 14:08 S06syslog -> ../syslog lrwxrwxrwx 1 root root 10 May 22 14:09 S07hotplug -> ../hotplug lrwxrwxrwx 1 root root 9 May 22 14:09 S08hwscan -> ../hwscan lrwxrwxrwx 1 root root 10 Jun 23 03:50 S08portmap -> ../portmap lrwxrwxrwx 1 root root 15 May 22 14:09 S08splash_early -> ../splash_early lrwxrwxrwx 1 root root 7 May 22 14:16 S08sshd -> ../sshd lrwxrwxrwx 1 root root 6 May 22 14:15 S09nfs -> ../nfs lrwxrwxrwx 1 root root 12 May 22 14:16 S10alsasound -> ../alsasound lrwxrwxrwx 1 root root 6 May 22 14:16 S10atd -> ../atd lrwxrwxrwx 1 root root 8 May 22 14:16 S10fbset -> ../fbset lrwxrwxrwx 1 root root 6 Jun 23 03:22 S10lpd -> ../lpd lrwxrwxrwx 1 root root 11 May 22 14:16 S10sendmail -> ../sendmail lrwxrwxrwx 1 root root 6 May 22 14:16 S11kbd -> ../kbd lrwxrwxrwx 1 root root 8 May 22 14:28 S11smbfs -> ../smbfs lrwxrwxrwx 1 root root 9 May 22 14:16 S11splash -> ../splash lrwxrwxrwx 1 root root 6 May 22 14:16 S11xdm -> ../xdm lrwxrwxrwx 1 root root 7 May 22 16:05 S12cron -> ../cron lrwxrwxrwx 1 root root 7 May 22 16:05 S12nscd -> ../nscd lrwxrwxrwx 1 root root 9 Aug 20 17:51 S12smpppd -> ../smpppd lrwxrwxrwx 1 root root 8 Jun 1 20:47 S20inetd -> ../inetd lrwxrwxrwx 1 root root 26 May 22 14:27 S22personal-firewall.final -> ../personal-firewall.final lrwxrwxrwx 1 root root 14 May 22 15:26 S22splash_late -> ../splash_late -rw------- 1 root root 58 Jun 14 02:40 nohup.out lrwxrwxrwx 1 root root 10 May 22 14:15 s08portmap -> ../portmap
All the ones with capital 'S' are started when the runtimeis begun. The ones with capital 'K' are ended when run level goes off.
As you can see, they are soft links to the ../ directory, where the scripts actually exist. You can start any script by hand with a command like this:
www2:/etc/init.d # ./lpd restart Shutting down lpd done Starting lpd done
That restarts the lpd print dameon.
You can change your run level with the init command
See: man init
As I said, we cover this in the GNU/Linux one class. It's really part of the basics of understanding your system.
See http://www.nylxs.com/classes/ for more information on classes.
Ruben
On 2002.10.12 01:34 Peter C. Norton wrote: > On Fri, Oct 11, 2002 at 02:29:03PM -0700, Jonathan Ellison wrote: > > Hi All, > > > > I install RedHat 8.0 successfully. But I notice that > > when I goto shutdown or reboot my linux box. It goes > > through the regular shutdown processes until the last > > few. Then I receive this message: > > > > " INIT: no more processes left in this runlevel. " > > You're not seeing a problem - you're seeing an informational message. > init is telling you that there's nothing else running, so its actually > quite happy and things are going well. > > -Peter > > -- > The 5 year plan: > In five years we'll make up another plan. > Or just re-use this one. > _______________________________________________ > The nylug-talk mailing list is at nylug-talk-at-nylug.org > To subscribe or unsubscribe: http://herzl.nylug.org/mailman/listinfo/nylug-talk > -- __________________________
Brooklyn Linux Solutions __________________________ DRM is THEFT - We are the STAKEHOLDERS http://www.nyfairuse.org
http://www.mrbrklyn.com - Consulting http://www.nylxs.com/radio - Free Software Radio Show and Archives http://www.tmm.net <-- Happy Clients http://www.brooklynonline.com - For the love of Brooklyn http://www.nylxs.com - Leadership Development in Free Software http://www.nyfairuse.org - The foundation of Democracy http://www2.mrbrklyn.com/resources - Unpublished Archive or stories and articles from around the net http://www2.mrbrklyn.com/mp3/dr.mp3 - Imagine my surprise when I saw you... http://www2.mrbrklyn.com/downtown.html - See the New Downtown Brooklyn....
1-718-382-0585
____________________________ New Yorker Free Software Users Scene Fair Use - because it's either fair use or useless....
|
|