Você está na página 1de 23

Unit 3

System startup and shutdown

Copyright IBM Corporation 2009


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

5.2

Unit objectives
IBM Power Systems

After completing this unit, you should be able to:


Describe the System and AIX startup process
Activate the System and AIX partitions
Understand the AIX startup modes
Describe the contents of the /etc/inittab file
Understand the role of the System Resource Controller and
how to manage subsystems
Explain how to shut down the system and AIX partitions

System startup
IBM Power Systems

Plug in managed system


Level 1: Power off

Service Processor is active

Issue Power On command


Level 2: Standby

Start AIX
partitions

Level 3: Operating

All devices are initialized and powered on.


System is ready to support partitions.

SMS mode

- OR Normal mode

System is running partitions.

Managed system activation


IBM Power Systems

#sshhscroot@<hmc>chsysstatem<ms_name>rsysoon

Start-up modes for AIX (1 of 2)


IBM Power Systems

The two most popular start-up modes are:


SMS mode (the firmware menu)
Normal mode

SMS mode is used for :


Selecting the boot device, for example: Network and IPL parameters
Booting into Service (Maintenance) mode, examples:
To fix a machine that will not boot
Recover root password

PowerPCFirmware
VersionEL320_083
SMS1.7(c)CopyrightIBMCorp.2000,2008Allrightsreserved.

MainMenu
1.SelectLanguage
2.SetupRemoteIPL(InitialProgramLoad)
3.ChangeSCSISettings
4.SelectConsole
5.SelectBootOptions

SMS Top
Level
Firmware
Menu

Start-up modes for AIX (2 of 2)


IBM Power Systems

Normal mode
AIX boots into multi-user mode (run level 2).
Users can log in, the system can be configured, and applications can start.
The bootlist command can set/change the start-up boot device.
## bootlist
bootlist -m
-m normal
normal -o
-o
hdisk0
blv=hd5
hdisk0 blv=hd5

Displays the current


boot device (hdisk0)

## bootlist
bootlist -m
-m normal
normal ent0
ent0 bserver=10.47.1.33
bserver=10.47.1.33 client=10.47.1.101
client=10.47.1.101

Other less common start-up modes:


Diagnostic with default boot list
Used to run diagnostics using diagnostic CD

Changes the current


normal bootlist to boot
over the network through
device ent0 to a network
install server 10.47.1.33

Diagnostic with stored boot list


Used to run online diagnostics

Open firmware
Open firmware prompt. Use by service/support personnel to obtain low level
debug information

AIX start up process overview


IBM Power Systems

Partition Activation

Locate AIX boot image


via firmware or bootlist
Load boot image
RAMFS created
Configure Devices
Start rootvg
Start real init process
From rootvg
LOGIN

AIX Kernel is now in control


init process from RAMFS
executes rc.boot script
Process /etc/inittab, default run-level 2

AIX partition activation (1 of 2)


IBM Power Systems

#sshhscroot@<hmc>chsysstatem<ms_name>rlpar\
oonn<lpar>f<profilename>bsms
To activate
into SMS

AIX partition activation (2 of 2)


IBM Power Systems

AIX
AIX Version
Version 66
Copyright
Copyright IBM
IBM Corporation,
Corporation, 1982,
1982, 2007
2007
Console
login:
Console login:

The alog command


IBM Power Systems

User
Applications

Boot
Process

NIM

Install
Process

alog program

Use the
alog
command
to view
logs

To view the boot log:


## alog
alog o
o t
t boot
boot

/var/adm/ras/bootlog
/var/adm/ras/BosMenus.log
/var/adm/ras/bosinst.log
/var/adm/ras/nimlog
/var/adm/ras/conslog
/var/adm/ras/errlog

/etc/inittab
IBM Power Systems

Format of the line: id:runlevel:action:command


init:2:initdefault:
init:2:initdefault:
brc::sysinit:/sbin/rc.boot
brc::sysinit:/sbin/rc.boot 33 >/dev/console
>/dev/console 2>&1
2>&1 ## Phase
Phase 33 of
of system
system boot
boot
powerfail::powerfail:/etc/rc.powerfail
2>&1
|
alog
-tboot
>
/dev/console
powerfail::powerfail:/etc/rc.powerfail 2>&1 | alog -tboot > /dev/console
mkatmpvc:2:once:/usr/sbin/mkatmpvc
mkatmpvc:2:once:/usr/sbin/mkatmpvc >/dev/console
>/dev/console 2>&1
2>&1
atmsvcd:2:once:/usr/sbin/atmsvcd
>/dev/console
atmsvcd:2:once:/usr/sbin/atmsvcd >/dev/console 2>&1
2>&1
tunables:23456789:wait:/usr/sbin/tunrestore
tunables:23456789:wait:/usr/sbin/tunrestore -R
-R >> /dev/console
/dev/console 2>&1
2>&1 ## Set
Set tunables
tunables
rc:23456789:wait:/etc/rc
rc:23456789:wait:/etc/rc 2>&1
2>&1 || alog
alog -tboot
-tboot >> /dev/console
/dev/console ## Multi-User
Multi-User checks
checks
rcemgr:23456789:once:/usr/sbin/emgr
rcemgr:23456789:once:/usr/sbin/emgr -B
-B >> /dev/null
/dev/null 2>&1
2>&1
fbcheck:23456789:wait:/usr/sbin/fbcheck
fbcheck:23456789:wait:/usr/sbin/fbcheck 2>&1
2>&1 || alog
alog -tboot
-tboot >> /dev/console
/dev/console
srcmstr:23456789:respawn:/usr/sbin/srcmstr
#
System
srcmstr:23456789:respawn:/usr/sbin/srcmstr # System Resource
Resource Controller
Controller
rctcpip:a:wait:/etc/rc.tcpip
rctcpip:a:wait:/etc/rc.tcpip >> /dev/console
/dev/console 2>&1
2>&1 ## Start
Start TCP/IP
TCP/IP daemons
daemons
rcnfs:a:wait:/etc/rc.nfs
rcnfs:a:wait:/etc/rc.nfs >> /dev/console
/dev/console 2>&1
2>&1 ## Start
Start NFS
NFS Daemons
Daemons
sniinst:2:wait:/var/adm/sni/sniprei
sniinst:2:wait:/var/adm/sni/sniprei >> /dev/console
/dev/console 2>&1
2>&1
cron:23456789:respawn:/usr/sbin/cron
cron:23456789:respawn:/usr/sbin/cron
qdaemon:a:wait:/usr/bin/startsrc
-sqdaemon
qdaemon:a:wait:/usr/bin/startsrc -sqdaemon
writesrv:a:wait:/usr/bin/startsrc
writesrv:a:wait:/usr/bin/startsrc -swritesrv
-swritesrv
uprintfd:23456789:respawn:/usr/sbin/uprintfd
uprintfd:23456789:respawn:/usr/sbin/uprintfd
shdaemon:2:off:/usr/sbin/shdaemon
shdaemon:2:off:/usr/sbin/shdaemon >/dev/console
>/dev/console 2>&1
2>&1 ## High
High availability
availability daemon
daemon
l2:2:wait:/etc/rc.d/rc
l2:2:wait:/etc/rc.d/rc 22
l3:3:wait:/etc/rc.d/rc
3
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc
l4:4:wait:/etc/rc.d/rc 44
l5:5:wait:/etc/rc.d/rc
l5:5:wait:/etc/rc.d/rc 55
l6:6:wait:/etc/rc.d/rc
l6:6:wait:/etc/rc.d/rc 66
l7:7:wait:/etc/rc.d/rc
l7:7:wait:/etc/rc.d/rc 77
l8:8:wait:/etc/rc.d/rc
l8:8:wait:/etc/rc.d/rc 88
l9:9:wait:/etc/rc.d/rc
l9:9:wait:/etc/rc.d/rc 99

Run levels
IBM Power Systems

Run levels on AIX:


0 and 1: Reserved for future use
2 default (normal): Multi-user mode
3 through 9: Free to be defined by the administrator

The telinit or init command can be used to change run


levels.
a, b, c and h can be initiated during any run level start-up, 2
through 9, without killing any existing run level processes.
S, s, M, m, results in the system entering single user /
maintenance mode.
Q, q, re-examines and processes the /etc/inittab file on request.
Example: To go from single user to multi-user mode, execute:
# telinit 2

Directory and script control


IBM Power Systems

Start-up and stops scripts can be defined for each run level
which are automatically invoked at entry and exit.
/etc/rc.d
/etc/rc.d ## ls
ls R
R
init.d
init.d rc
rc
./init.d:
./init.d:

rc2.d
rc2.d

./rc2.d:
./rc2.d:
Ksshd
Ksshd Kwpars
Kwpars Ssshd
Ssshd
./rc3.d:
./rc3.d:
./rc4.d:
./rc4.d:

rc3.d
rc3.d

rc4.d
rc4.d

rc5.d
rc5.d

rc6.d
rc6.d

rc7.d
rc7.d

rc8.d
rc8.d

rc9.d
rc9.d

Scripts starting
with S are invoked
at boot time by
/etc/rc.d/rc

./rc5.d:
./rc5.d:
./rc6.d:
./rc6.d:
./rc7.d:
./rc7.d:
./rc8.d:
./rc8.d:
./rc9.d:
./rc9.d:

Scripts starting with K are


invoked synchronously by
shutdown with one argument:
'stop'. They are also called on
start-up prior to invoking the
start scripts.

System resource controller


IBM Power Systems

Provides a single interface to control subsystems


Controls individual subsystems or groups of subsystems
## ps
ps -ef
-ef |grep
|grep src
src
UID
PID
UID
PID PPID
PPID
root
172178
11
root 172178
## ps
ps -T
-T 172178
172178
PID
TTY
PID
TTY
172178
-172178
151672
-151672
163968
-163968
303160
-303160
512170
pts/0
512170 pts/0
463024
463024 pts/0
pts/0
168088
-168088
180418
-180418
188650
-188650
200856
-200856
204904
-204904
176288
-176288
213102
-213102
221334
-221334
254124
-254124
262276
-262276
417800
-417800

CC
00

STIME
STIME
18
18 Sep
Sep

SRC
Master
process

TTY
TTY TIME
TIME CMD
CMD
-- 0:00
0:00 /usr/sbin/srcmstr
/usr/sbin/srcmstr

TIME
TIME CMD
CMD
0:00
0:00 srcmstr
srcmstr
0:01
|\--syslogd
0:01
|\--syslogd
0:00
|\--inetd
0:00
|\--inetd
0:00
||
\--rlogind
0:00
\--rlogind
0:00
|
\--ksh
0:00
|
\--ksh
0:00
||
\--ps
0:00
\--ps
0:00
|\--portmap
0:00
|\--portmap
0:00
|\--IBM.ServiceRMd
0:00
|\--IBM.ServiceRMd
1:24
|\--rmcd
1:24
|\--rmcd
3:47
|\--clstrmgr
3:47
|\--clstrmgr
0:00
|\--tftpd
0:00
|\--tftpd
0:00
|
\--tftpd
0:00
|
\--tftpd
0:00
|\--sshd
0:00
|\--sshd
0:00
|\--snmpdv3ne
0:00
|\--snmpdv3ne
0:00
|\--IBM.DRMd
0:00
|\--IBM.DRMd
0:59
|\--IBM.CSMAgentRMd
0:59
|\--IBM.CSMAgentRMd
0:00
\--ctcasd
0:00
\--ctcasd

Parent
PID = init
Subsystem

Subserver

Listing subsystems
IBM Power Systems

The lssrc command is used to list subsystems


## lssrc
lssrc -a
-a
Subsystem
Subsystem
syslogd
syslogd
portmap
portmap
inetd
inetd
tftpd
tftpd
sshd
sshd
ctrmc
ctrmc
snmpd
snmpd
clcomdES
clcomdES
clstrmgrES
clstrmgrES
ctcas
ctcas
qdaemon
qdaemon
writesrv
writesrv
lpd
lpd

Group
Group
ras
ras
portmap
portmap
tcpip
tcpip
tcpip
tcpip
ssh
ssh
rsct
rsct
tcpip
tcpip
clcomdES
clcomdES
cluster
cluster
rsct
rsct
spooler
spooler
spooler
spooler
spooler
spooler

PID
PID
151672
151672
168088
168088
163968
163968
204904
204904
213102
213102
188650
188650
221334
221334
225414
225414
200856
200856
417800
417800

Status
Status
active
active
active
active
active
active
active
active
active
active
active
active
active
active
active
active
active
active
active
active
inoperative
inoperative
inoperative
inoperative
inoperative
inoperative

PID
PID
163968
163968
204904
204904
221334
221334

Status
Status
active
active
active
active
active
active

.
. Removed
Removed for
for clarity
clarity ..
..
## lssrc
lssrc g
g tcpip
tcpip |grep
|grep active
active
Subsystem
Group
Subsystem
Group
inetd
tcpip
inetd
tcpip
tftpd
tcpip
tftpd
tcpip
snmpd
tcpip
snmpd
tcpip

SRC Control
IBM Power Systems

Controlling subsystems
## stopsrc
stopsrc -s
-s inetd
inetd
0513-044
The
0513-044 The /usr/sbin/inetd
/usr/sbin/inetd Subsystem
Subsystem was
was requested
requested to
to stop.
stop.
## startsrc
startsrc -s
-s inetd
inetd
0513-059
The
0513-059 The inetd
inetd Subsystem
Subsystem has
has been
been started.
started. Subsystem
Subsystem PID
PID is
is
311374.
311374.
## refresh
refresh -s
-s inetd
inetd
0513-095
The
0513-095 The request
request for
for subsystem
subsystem refresh
refresh was
was completed
completed
successfully.
successfully.
Not all
subsystems
support being
refreshed.

## refresh
refresh -s
-s sshd
sshd
0513-005
The
0513-005 The Subsystem,
Subsystem, sshd,
sshd, only
only supports
supports signal
signal communication.
communication.

AIX partition shutdown (1 of 2)


IBM Power Systems

The shutdown command, by default


Gracefully stops all activity on the system
Warns users of an impending shutdown
## shutdown
shutdown -Fr
-Fr

Do a fast shutdown,
bypassing the
messages to users,
and reboot the
system.

SHUTDOWN
SHUTDOWN PROGRAM
PROGRAM
Thu
Thu 99 Oct
Oct 20:15:49
20:15:49 2008
2008
0513-044
The
0513-044 The sshd
sshd Subsystem
Subsystem was
was requested
requested to
to stop.
stop.
Wait
for
'Rebooting...'
before
stopping.
Wait for 'Rebooting...' before stopping.
Oct
Oct 99 2008
2008 20:15:50
20:15:50 /usr/es/sbin/cluster/utilities/clstop:
/usr/es/sbin/cluster/utilities/clstop: called
called with
with
flags
-f
-y
-s
-N
-S
flags -f -y -s -N -S
0513-004
0513-004 The
The Subsystem
Subsystem or
or Group,
Group, clinfoES,
clinfoES, is
is currently
currently inoperative.
inoperative.
Error
Error logging
logging stopped...
stopped...
Advanced
Advanced Accounting
Accounting has
has stopped...
stopped...
Process
accounting
stopped...
Process accounting stopped...
Stopping
Stopping NFS/NIS
NFS/NIS Daemons
Daemons
Connection
Connection closed.
closed.

AIX partition shutdown (2 of 2)


IBM Power Systems

AIX shutdown can also be initiated from the HMC.


#sshhscroot@<hmc>chsysstate -o osshutdown

Do a fast
shutdown,
shutdown -F

Managed system shutdown


IBM Power Systems

Ensure all partitions have been shutdown first!


#sshhscroot@<hmc>chsysstatem<ms_name>rsysooff

Checkpoint
IBM Power Systems

1.

What is the first process that is created on the system


and which file does it reference to initiate all the other
processes that have to be started?
____________________________________________
____________________________________________

2.

Which AIX feature can be used to stop and start


subsystems and groups of daemons ?
____________________________________________

3.

True or False: You can only execute the shutdown


command from the console.

Checkpoint solutions
IBM Power Systems

1.

What is the first process that is created on the system


and which file does it reference to initiate all the other
processes that have to be started?
The initial process is ignit. The file init references is
/etc/inittab for information regarding other processes
that have to be started.

2.

Which AIX feature can be used to stop and start


subsystems and groups of daemons ?
The System Resource Controller (SRC)

3.

True or False: You can only execute the AIX shutdown


command from the console.

Exercise 3
IBM Power Systems

System startup and


shutdown

Unit summary
IBM Power Systems

Having completed this unit, you should be able to:


Describe the System and AIX startup process
Activate the System and AIX partitions
Understand the AIX startup modes
Describe the contents of the /etc/inittab file
Understand the role of the System Resource Controller
and how to manage subsystems
Explain how to shut down the system and AIX partitions

Você também pode gostar