summaryrefslogtreecommitdiff
path: root/sag-0.6.1-www/Invisible/sag-0.6/node76.html
blob: 3fc9d010555d8879c29fc5ae83498f0898e58dba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>Run levels</TITLE>
<META NAME="description" CONTENT="Run levels">
<META NAME="keywords" CONTENT="sag">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<LINK REL=STYLESHEET HREF="sag.css">
</HEAD>
<BODY LANG="EN" >
 <A NAME="tex2html1269" HREF="node77.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="./next_motif.gif"></A> <A NAME="tex2html1267" HREF="node73.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="./up_motif.gif"></A> <A NAME="tex2html1261" HREF="node75.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="./previous_motif.gif"></A> <A NAME="tex2html1271" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="./contents_motif.gif"></A> <A NAME="tex2html1272" HREF="node114.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="./index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html1270" HREF="node77.html">Special configuration in /etc/inittab</A>
<B>Up:</B> <A NAME="tex2html1268" HREF="node73.html">init</A>
<B> Previous:</B> <A NAME="tex2html1262" HREF="node75.html">Configuring init to start </A>
<BR> <P>
<H1><A NAME="SECTION00830000000000000000">Run levels</A></H1>
<P>
	A <b>run level</b> is a state of <tt>init</tt><A NAME="2432">&#160;</A> and the whole
	system that defines what system services are operating. Run
	levels are identified by numbers, see table&nbsp;<A HREF="node76.html#tabrunlevels">7.1</A>.
	There is no consensus of how to use the user defined run levels
	(2 through 5). Some system administrators use run levels to
	define which subsystems are working, e.g., whether X is running,
	whether the network is operational, and so on. Others have all
	subsystems always running or start and stop them individually,
	without changing run levels, since run levels are too coarse
	for controlling their systems.	You need to decide for yourself,
	but it might be easiest to follow the way your Linux distribution
	does things.
<P>
		<P><A NAME="2242">&#160;</A><A NAME="tabrunlevels">&#160;</A><IMG WIDTH=381 HEIGHT=89 ALIGN=BOTTOM ALT="table2241" SRC="img12.gif"><BR>
<STRONG>Table 7.1:</STRONG> Run level numbers<BR>
<P>
<P>
	Run levels are configured in <tt>/etc/inittab</tt><A NAME="2434">&#160;</A> by lines like
	the following:
<BLOCKQUOTE> <TT>
l2:2:wait:/etc/init.d/rc 2
</TT></BLOCKQUOTE>
	The first field is an arbitrary label, the second one means
	that this applies for run level 2. The third field means that
	<tt>init</tt><A NAME="2436">&#160;</A> should run the command in the fourth field once,
	when the run level is entered, and that <tt>init</tt><A NAME="2438">&#160;</A> should wait
	for it to complete. The
	<tt>/etc/init.d/rc</tt><A NAME="2440">&#160;</A> command runs whatever commands are necessary
	to start and stop services to enter run level 2.
<P>
	The command in the fourth field does all the hard work of
	setting up a run level. It starts services that aren't already
	running, and stops services that shouldn't be running in the
	new run level any more. Exactly what the command is, and how
	run levels are configured, depends on the Linux distribution.
<P>
	When <tt>init</tt><A NAME="2442">&#160;</A> starts, it looks for a line in <tt>/etc/inittab</tt><A NAME="2444">&#160;</A>
	that specifies the default run level:
<BLOCKQUOTE> <TT>
id:2:initdefault:
</TT></BLOCKQUOTE>
	You can ask <tt>init</tt><A NAME="2446">&#160;</A> to go to a non-default
	run level at startup by giving the kernel a command line
	argument of <tt>single</tt> or <tt>emergency</tt>.<A NAME="tex2html36" HREF="footnode.html#2312"><IMG  ALIGN=BOTTOM ALT="gif" SRC="./foot_motif.gif"></A> This allows you to choose
	the single user mode (run level 1), which is described in
	section&nbsp;<A HREF="node78.html#secsingleusermode">7.5</A>.
<P>
	While the system is running, the <tt>telinit</tt><A NAME="2448">&#160;</A> command can change
	the run level. When the run level is changed, <tt>init</tt><A NAME="2450">&#160;</A> runs
	the relevant command from <tt>/etc/inittab</tt><A NAME="2452">&#160;</A>.
<P>
<HR><A NAME="tex2html1269" HREF="node77.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="./next_motif.gif"></A> <A NAME="tex2html1267" HREF="node73.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="./up_motif.gif"></A> <A NAME="tex2html1261" HREF="node75.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="./previous_motif.gif"></A> <A NAME="tex2html1271" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="./contents_motif.gif"></A> <A NAME="tex2html1272" HREF="node114.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="./index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html1270" HREF="node77.html">Special configuration in /etc/inittab</A>
<B>Up:</B> <A NAME="tex2html1268" HREF="node73.html">init</A>
<B> Previous:</B> <A NAME="tex2html1262" HREF="node75.html">Configuring init to start </A>
<P><ADDRESS>
<I>Lars Wirzenius <BR>
Sat Nov 15 02:32:11 EET 1997</I>
</ADDRESS>
</BODY>
</HTML>