Thursday 19 May 2011

AIX System Start-up and Shut-down

AIX Boot Process


Objectives for this module
•Describe how AIX system boots up
•Understand /etc/inittab file
•Work with System Environment
•How to shut down the system




There are various ways to startup your system.
a.Normal Startup ->When you want your system to come up to a working stage, you will usually startup your system in normal startup mode. In this startup mode, all the relevant processes are running. It would show you a login screen to logon to the system and the system would come up in a multi-user mode.
b.SMS (System Management Services) ->When your system is coming up and when its in the POST stage, if you press F1key you get into System Management Services (SMS). The programs that you see in SMS are not part of the Operating System (AIX) but are part of the firmware. SMS can be used to set the bootlistfor your system, set power-on password and supervisory passwords.
c.Maintenance->When you have some problem due to which you can not startup your system in normal mode, you may have to get into maintenance mode to do maintenance tasks to bring your system up. This mode is called the Maintenance mode. For example, if you have forgotten the root password and want to recover the same, you can do it in maintenance mode.
d. Diagnostics ->When your system doesn’t boot and you feel there could be a device related problem, you can startup in diagnostics mode i.e. diagnose and check the device for potential problems and then try for a normal startup.

Starting System Management Services
• Power on the system
• Press F1 when icons appear and tones sound

System Management Services
When your system is coming up and you are in the POST stage, you can get into System Management Services (SMS) by pressing F1 key.
The visual above is the SMS screen. As discussed earlier, SMS can be used to look at the configuration of your system, in terms of hardware. You also have an option called Boot(On some machines it could also be multiboot) which can be used to see the bootlistfor the machine and if required change it. You also have an option called utilities which contains certain utility options like upgrading the firmware version etc.
This is the GUI ( Graphical User Interface)version of the SMS. SMS is also available in TUI (Text User Interface)version which is the default interface on ASCII terminals.

Startup Procedure

These are the basic procedures that happen during the system startup.
1.PowerOn->startup procedure starts when you power on your system.
2.POST->After the system is powered on, POST(Power On Self Test) happens. This step will conduct a basic power on test on devices like memory, keyboard, communication adapters and audio components. During this stage you can see the respective icons appearing on the screen.
3. Locate and Load boot image->Once POST is done, from the firmware’s bootlistthe system understands the boot device, on the boot device, the first 512 bytes block( first sector) contains a program called the bootstrap loader. This small program called bootstrap loader is loaded onto the memory. The job of the bootstrap loader program is to load the operating system (kernel), so from the boot device, it detects the boot logical volume and loads the kernel onto the memory.
4. Cfgmgr(Configuration Manager)-Once the kernel is loaded onto the memory by the bootstrap loader program, the AIX kernel gets the control. The kernel then calls the program called Configuration Manager (cfgmgr) which configures all the devices. After the devices have been configured, the kernel invokes the first process on the system called init, init in turn looks at a configuration file called /etc/inittab and continues to do processes that are listed in the file.

The bootinfo Command
•To view the architecture type:
# bootinfo -p
rs6k MCA model
rspc PCI model (POWER Reference Platform)
chrp PCI model (Common Hardware Reference)

•To view the bit addressing:
# bootinfo -y
32 32-bit
64 64-bit

Aix logs
Alog program in AIX is a general logging feature in AIX. Alogstands for AIX log.
•User applications, Boot process, NIM (Network Installation Manager) or Installation process could generate lot of messages that needs to logged onto log files. This job is taken care by the alog program. The alog program receives all information from these processes and logs them onto the respective log files.
•You can actually use these commands to work with the alog:
#alog–L-> Gives you a list of alogs types that are available.
#alog–o –t boot-> If you want to look at the boot alog and see the output of the same you can use this command.
( -o : output ; -t : type of alog)

/etc/inittab

As discussed earlier, init is the first process to start on your system and init looks into the /etc/inittab file to start other processes on the system.
The file /etc/inittab is a very important file and if this file gets corrupted, the system will not boot properly. So take care whenever you modify this file.
Each of the lines in the /etc/inittab file follows a syntax, made up of 4 fields.
The fields are:-
1.Identifier ->Name/identifier for the process. Can be upto14 characters long.
2.runlevel->Specified in which run level this particular process runs. The valid run-levels could be 0-9. The default run-level for the AIX system is 2 which is Multiuser mode.
3.Action ->How to work with the process. Valid values could be:
a.sysinit:     processes to run during system initialization
b.respawn:  If the process is not started already, start it.
c.off :          Do not run the process
d.once :      Start the process and do not restart if it stops
e.wait :       start the process and wait before going to the next line.
Telinit command can be used to change the run-level or to force re-reading of the /etc/inittab file

SRC (System Resource Controller)

One of the unique facilities available on AIX is System Resource Controller (SRC). The SRC gives a set of commands that make it very easy for the system administrator to maintain and manage the subsystems and subservers running on your AIX system.

What is a subsystem ?
Subsystem is a set of related programs designed to perform one particular function. The subsystems can be sub divided into subservers(daemons).
SRC helps you to manage the whole subsystems and their respective subservers by creating subsystem groups. You can use SRC related commands to start/stop/refresh the subsystems and subservers.
In the example above, there is a subsystem group called tcpip. Under the subsystem group called tcpip you have a subsystem called inetd. Under the subsystem called inetd you have a subserver called telnet.
So to work with either the group called tcpip or the subsystem called inetdor the subserver called telnet, you need to use the SRC set of commands.
System Resource Controller Syntax
List SRC status:

# lssrc -g spooler
subsystem   Group PID     Status
qdaemon     spooler8022  active
writesrv       spooler9558  active
lpd              spooler        inoperative

Start a subsystem:
# startsrc -s lpd
0513-059 The lpd Subsystem has been started.Subsystem PID is 12472.

Refresh a subsystem:
# refresh -s lpd
0513-095 The request for subsystem refresh was completed successfully.

Stop a subsystem:
# stopsrc -s lpd
0513-044 The lpd Subsystem was requested to stop.

The command lssrc–a can be used to get a list of all the subsystems/subservers taken care by the SRC.
In the example above, -g stands for group. The output shows all the subsystems and subservers under the group called tcpip and their status, i.e. whether they are in-operative or active.

To start a subsystem you can use the following command:
#startsrc–s inetd

To refresh a subsystem, you can use the following command:
#refresh –s inetd

To stop a subsystem, you can use the following command
#stopsrc–s inetd

It is not recommended to use kill commands on the processes that are managed by the SRC. Its better to use stopsrc and startsrc to manage these kinds of processes.

Managing Processes

The command ps–ef can be used to get the process status of all the processes running on your system.
The findings from the above listing is that, SRC ( System Resource Controller) is started by the init process ( see the PPID(parent process ID) and its PID(process ID) is 5822. Other processes like for example inetd has been started by the SRC ( see inetd’sPPID) and its process ID is 10320.

This output clearly gives you information about which processes are directly started by the init process and which processes are handled by the SRC (System Resource Controller).

So lets say you want to kill inetd, instead of using the command
# kill 10320( remember its not good to use kill command on processes that are taken care by the SRC)

You will have to use
#stopsrc–s inetd

Shutdown

You can use the high level command called
#shutdown to shut the system down.You can also use the fastpath shutdown to do the same

#smit shutdown
Shutdown command stops all the processes that are running on the system and it will also send a warning message to all the users logged on about the fact that the system is coming down.

There are various options available with shutdown command:
-F: Fast shutdown. Bypasses all messages to users and quickly shuts the system.
-m: Brings the system to maintenance mode (single user mode)
-h :Halts the operating system completely
-i:specified interactive mode. Displays messages to guide the user through shutdown process.

System Environment

You can use the fastpath #smit system to go to this menu to control different options set on your system.

You can stop the system (shutdown the system), You can change the console assignment for your system, you can change/see the date and time settings.

You can work with language settings for your system, change the number of licensed users, manage the system logs, etc..



List of search terms
AIX start-up process
AIX boot process
alog command
managing AIX process
ps command in aix
/etc/inittab
system resource controller (SRC)
AIX startup and shutdown process
Booting in AIX
System startup in AIX
AIX system startup

2 comments: