You are on page 1of 23

System startup and shutdown

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp 8.1
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
Explain the difference between SMS and normal startup
modes
Describe the contents of the /etc/inittab file
Use System Resource Controller commands to start, stop,
and display AIX subsystems
Explain how to shut down the system and AIX partitions

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
System startup
IBM Power Systems

Plug in managed system


Level 1: Power off Service processor is active.

Issue Power On command


All devices are initialized and powered on.
Level 2: Standby
System is ready to support partitions.

SMS mode
Start AIX - OR -
partitions
Normal mode

Level 3: Operating System is running partitions.

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
Managed system activation
IBM Power Systems

# ssh hscroot@<hmc> chsysstate -m <ms_name> -r sys -o on

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
Startup 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, for example:
To fix a machine that will not boot
Recover root password
SMS Top
Level
PowerPC Firmware
Version EL320_083 Firmware
SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved. Menu
----------------------------------------------------------------
Main Menu
1. Select Language
2. Setup Remote IPL (Initial Program Load)
3. Change SCSI Settings
4. Select Console
5. Select Boot Options

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
Startup 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 change the start-up boot device list.

## bootlist Displays the current


bootlist -m
-m normal
normal -o
-o
hdisk0 boot device (hdisk0)
hdisk0 blv=hd5
blv=hd5

## bootlist
bootlist m
m normal
normal hdisk0
hdisk0 hdisk1
hdisk1

Other less common start-up modes:


Diagnostic with default boot list
Boot to service mode using default boot list (has optical drive first)
Diagnostic with stored boot list
Boot to service mode using a user customized bootlist
Open firmware
Open firmware prompt; used by service/support personnel to obtain low level
debug information
Copyright IBM Corporation 2009, 2013. All Rights Reserved.
US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
AIX startup process overview
IBM Power Systems

Partition activation

Locate AIX boot image


via firmware or bootlist

Load boot image


RAMFS created AIX Kernel is now in control.

Configure devices init process from RAMFS


Start rootvg executes rc.boot script.

Start real init process


Process /etc/inittab, default run-level 2.
From rootvg

LOGIN Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
AIX partition activation (1 of 2)
IBM Power Systems

# ssh hscroot@<hmc> chsysstate -m <ms_name> -r lpar \


-o on -n <lpar> -f <profile name> -b sms

To activate
into SMS

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
AIX partition activation (2 of 2)
IBM Power Systems

AIX
AIX Version
Version 77
Copyright
Copyright IBM
IBM Corporation,
Corporation, 1982,
1982, 2013
2013
Console
Console login:
login:

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
The alog command
IBM Power Systems

User Boot Install


NIM
Applications Process Process

alog program

/var/adm/ras/bootlog
/var/adm/ras/BosMenus.log
Use the
/var/adm/ras/bosinst.log
alog
command
/var/adm/ras/nimlog
to view /var/adm/ras/conslog
logs /var/adm/ras/errlog

To view the boot log:


## alog
alog o
o t
t boot
boot

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
/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
powerfail::powerfail:/etc/rc.powerfail 2>&12>&1 || alog
alog -tboot
-tboot >> /dev/console
/dev/console
mkatmpvc:2:once:/usr/sbin/mkatmpvc
mkatmpvc:2:once:/usr/sbin/mkatmpvc >/dev/console
>/dev/console 2>&12>&1
atmsvcd:2:once:/usr/sbin/atmsvcd
atmsvcd:2:once:/usr/sbin/atmsvcd >/dev/console
>/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>&12>&1 || alog
alog -tboot
-tboot >> /dev/console
/dev/console
srcmstr:23456789:respawn:/usr/sbin/srcmstr
srcmstr:23456789:respawn:/usr/sbin/srcmstr ## System
System Resource
Resource Controller
Controller
rctcpip:23456789:wait:/etc/rc.tcpip
rctcpip:23456789:wait:/etc/rc.tcpip >> /dev/console
/dev/console 2>&1
2>&1 ## Start
Start TCP/IP
TCP/IP daemons
daemons
rcnfs:23456789:wait:/etc/rc.nfs
rcnfs:23456789: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:23456789:wait:/usr/bin/startsrc
qdaemon:23456789:wait:/usr/bin/startsrc -sqdaemon
-sqdaemon
writesrv:23456789:wait:/usr/bin/startsrc
writesrv:23456789: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
l3:3:wait:/etc/rc.d/rc 33
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


Copyright IBM Corporation 2009, 2013. All Rights Reserved.
US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
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

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
Directory and script control
IBM Power Systems

Startup and stop 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 rc2.d
rc2.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
./init.d:
./init.d:

./rc2.d:
./rc2.d:
Ksshd
Ksshd Kwpars
Kwpars Ssshd
Ssshd Scripts starting
with S are invoked
./rc3.d:
./rc3.d: at boot time by
./rc4.d:
./rc4.d:
/etc/rc.d/rc.

./rc5.d:
./rc5.d:

./rc6.d:
./rc6.d:
Scripts starting with K are
./rc7.d:
./rc7.d:
invoked synchronously by
shutdown with one argument:
./rc8.d:
./rc8.d: 'stop'. They are also called on
startup prior to invoking the start
./rc9.d:
./rc9.d: scripts.

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
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 SRC
UID
UID PID
PID PPID
PPID CC STIME
STIME TTY
TTY TIME
TIME CMD
CMD Master
root
root 172178
172178 11 00 18
18 Sep
Sep -- 0:00
0:00 /usr/sbin/srcmstr
/usr/sbin/srcmstr process
## ps
ps -T
-T 172178
172178
PID
PID TTY
TTY TIME
TIME CMD
CMD
Parent
172178
172178 -- 0:00
0:00 srcmstr
srcmstr PID = init
151672
151672 -- 0:01
0:01 |\--syslogd
|\--syslogd
163968
163968 -- 0:00
0:00 |\--inetd
|\--inetd
303160 -- 0:00 || \--rlogind
303160
512170
0:00 \--rlogind Subsystem
512170 pts/0
pts/0 0:00
0:00 || \--ksh
\--ksh
463024
463024 pts/0
pts/0 0:00
0:00 || \--ps
\--ps
168088
168088 -- 0:00
0:00 |\--portmap
|\--portmap
180418
180418 -- 0:00
0:00 |\--IBM.ServiceRMd
|\--IBM.ServiceRMd
188650 -- 1:24 |\--rmcd
188650
200856 --
1:24
3:47
|\--rmcd
|\--clstrmgr
Subserver
200856 3:47 |\--clstrmgr
204904
204904 -- 0:00
0:00 |\--tftpd
|\--tftpd
176288
176288 -- 0:00
0:00 || \--tftpd
\--tftpd
213102
213102 -- 0:00
0:00 |\--sshd
|\--sshd
221334
221334 -- 0:00
0:00 |\--snmpdv3ne
|\--snmpdv3ne
254124
254124 -- 0:00
0:00 |\--IBM.DRMd
|\--IBM.DRMd
262276
262276 -- 0:59
0:59 |\--IBM.CSMAgentRMd
|\--IBM.CSMAgentRMd
417800
417800 -- 0:00
0:00 \--ctcasd
\--ctcasd

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
Listing subsystems
IBM Power Systems

The lssrc command is used to list subsystems.


## lssrc
lssrc -a
-a
Subsystem
Subsystem Group
Group PID
PID Status
Status
syslogd
syslogd ras
ras 151672
151672 active
active
portmap
portmap portmap
portmap 168088
168088 active
active
inetd
inetd tcpip
tcpip 163968
163968 active
active
tftpd
tftpd tcpip
tcpip 204904
204904 active
active
sshd
sshd ssh
ssh 213102
213102 active
active
ctrmc
ctrmc rsct
rsct 188650
188650 active
active
snmpd
snmpd tcpip
tcpip 221334
221334 active
active
clcomdES
clcomdES clcomdES
clcomdES 225414
225414 active
active
clstrmgrES
clstrmgrES cluster
cluster 200856
200856 active
active
ctcas
ctcas rsct
rsct 417800
417800 active
active
qdaemon
qdaemon spooler
spooler inoperative
inoperative
writesrv
writesrv spooler
spooler inoperative
inoperative
lpd
lpd spooler
spooler inoperative
inoperative

.
. Removed
Removed for clarity ..
for clarity ..

lssrc g
## lssrc g tcpip
tcpip |grep
|grep active
active
Subsystem
Subsystem Group
Group PID
PID Status
Status
inetd
inetd tcpip
tcpip 163968
163968 active
active
tftpd
tftpd tcpip
tcpip 204904
204904 active
active
snmpd
snmpd tcpip
tcpip 221334
221334 active
active

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
SRC control
IBM Power Systems

Controlling subsystems
## stopsrc
stopsrc -s
-s inetd
inetd
0513-044
0513-044 The
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
0513-059 The
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
0513-095 The request
The 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
0513-005 The
The Subsystem,
Subsystem, sshd,
sshd, only
only supports
supports signal
signal
communication.
communication.
Copyright IBM Corporation 2009, 2013. All Rights Reserved.
US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
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.
Do a fast shutdown,
bypassing the
## shutdown
shutdown -Fr
-Fr messages to users,
SHUTDOWN and reboot the
SHUTDOWN PROGRAM
PROGRAM
Thu system.
Thu 99 Oct
Oct 20:15:49
20:15:49 2008
2008
0513-044
0513-044 The
The sshd
sshd Subsystem
Subsystem was
was requested
requested to
to stop.
stop.
Wait
Wait for
for 'Rebooting...'
'Rebooting...' before
before stopping.
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
flags -f
-f -y
-y -s
-s -N
-N -S
-S
0513-004
0513-004 The
The Subsystem
Subsystem oror 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
Process accounting
accounting stopped...
stopped...
Stopping
Stopping NFS/NIS
NFS/NIS Daemons
Daemons

Connection
Connection closed.
closed.

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
AIX partition shutdown (2 of 2)
IBM Power Systems

AIX shutdown can also be initiated from the HMC.


# ssh hscroot@<hmc> chsysstate -o osshutdown

Do a fast
shutdown,
shutdown -F

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
Managed system shutdown
IBM Power Systems

Ensure all partitions have been shut down first!


# ssh hscroot@<hmc> chsysstate -m <ms_name> -r sys -o off

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
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.

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
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 answer is the initial process is init. 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 answer is the System Resource Controller (SRC).

3. True or False: You can only execute the AIX shutdown command
from the console.
The answer is false.

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
Exercise
IBM Power Systems

System startup and


shutdown

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
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
Explain the difference between SMS and normal startup
modes
Describe the contents of the /etc/inittab file
Use System Resource Controller commands to start, stop,
and display AIX subsystems
Explain how to shut down the system and AIX partitions

Copyright IBM Corporation 2009, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp