Linux with Operating System Concepts



Download 5,65 Mb.
Pdf ko'rish
bet170/254
Sana22.07.2022
Hajmi5,65 Mb.
#840170
1   ...   166   167   168   169   170   171   172   173   ...   254
Bog'liq
Linux-with-Operating-System-Concepts-Fox-Richard-CRC-Press-2014

runlevel
(see below). The file may include other statements that 
establish actions to perform based on various conditions. The format of inittab instruc-
tions is 
name:#:action:process
. The 
name
an identifier of up to four letters. The # is 
a number in the range from 0 to 6 indicating the runlevel. The action specifies what action 
should take place on the named process.
To establish the default runlevel, inittab will include a statement with the action 
init-
default
and with no process. The initdefault action sets the runlevel, to be used later in 
the operating system initialization process. The following statement is used to establish a 
runlevel of 5.
id:5:initdefault:
Editing this file and altering the number from 5 to another runlevel will cause the system 
to enter another runlevel the next time you boot the computer.
Other statements can be added to inittab to control the actions for differing conditions. 
These instructions can contain actions such as 
respawn

wait

boot

sysinit

pow-
erfail
, or 
ctrlaltdel
. Several examples follow to explore these actions and the syntax 
of the statements:
• 
rc::bootwait:/etc/rc
—this command executes the /etc/rc script during the init 
process but does not establish a runlevel. The 
bootwait
action specifies that the init 
process must wait until /etc/rc completes execution.
• 
2:1:respawn:/etc/getty 9600 tty2
—the action 
respawn
indicates that 
the given process should run when a current tty terminates. The process is /etc/getty, 
which opens a new tty (terminal window with a login screen). Thus, if someone logs 
off, a new login window will appear. This command sets the runlevel to 1.
• 
ca::ctrlaltdel:/sbin/shutdown –t90 120 “shutting down now”

when the user presses ctrl 
+
alt 
+
del, /sbin/shutdown will run with parameters 
–t90 
120 “shutting down now”
. The 
–t90
indicates that the message “shutting down 
now” is sent out followed by a 90-seconds delay. The shutdown occurs in 120 seconds. 
Therefore, after pressing ctrl 
+
alt 
+
del, there is a 30-seconds delay before the mes-
sage followed by a 90-seconds delay before shutdown takes place.


452

Linux with Operating System Concepts
• 
umnt:1:once:umount –a
—the action 
once
indicates that upon changing to this 
runlevel, perform the umount operation, unmounting all mounted partitions leaving 
access only to / (the root partition).
• 
si::sysinit:/etc/rc.d/rc.sysinit
—the action 
sysinit
indicates that the 
process should run during system initialization and before any boot or bootwait 
entries. In this case, upon the inittab executing, the script rc.sysinit executes. This 
entry is no longer needed because Upstart takes care of executing the initial shell 
scripts for us.
• 
pw::powerwait:/usr/sbin/saveall
—the action 
powerwait
indicates 
that the process 
saveall
should run if an uninterruptible power supply (UPS) 
has kicked in because the computer has lost its power supply. Typically, a UPS will 
only have battery power for 20–30 min and so it is important in the interim that 
the system be shut down properly. The fictitious process /usr/sbin/saveall presum-
ably will be a program added to the system that ensures that all files are saved and 
closed properly so that a sudden loss of power does not cause damage to the file 
system.
You might notice in several cases, no runlevel was specified. The inittab allows us to 
define a number of situations whereby processes are invoked without changing the default 
runlevel.
Linux has seven different runlevels. These levels dictate which services should start and 
which should not. Through the selection of services, Linux either boots to a GUI or a text-
based platform, provides network access or not, and permits multiple users or only single 
user (root) access. The runlevels are given in Table 11.2. The most common runlevel is 
either 5 for most workstations or 3 for some servers (which are not expected to be used as a 
TABLE 11.2 
Linux Runlevels

Download 5,65 Mb.

Do'stlaringiz bilan baham:
1   ...   166   167   168   169   170   171   172   173   ...   254




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish