ABC Of AIX

Welcome to the World of AIX learning!!!

Syntax for /etc/inittab

leave a comment »

This post will discuss about the syntax used in /etc/inittab.

Remember, run level for the system is always read from /etc/inittab

Syntax:

<ID>:<Run Level>:<Action>:<Command>

Run level is used for maintenance purpose.

In AIX, there are 10 run levels from 0 to 9.

0 and 1 is reserved run levels.

2 is default run level.

3 to 9 is user defined run level.

Eg:

Oracle:2/3/6/8:<once>/<wait>/<respawn>:startsrc –s oracle

Explanation:

Oracle is the ID,

2/3/6/8 is the run level for this particular process,

Once, wait, respawn is the action taken on this particular process where once means the process will run and stop, wait means will wait for the process to complete (if error occurs will stop, system needs to be rebooted then) & respawn means if the process does not exists, it will start it.

Startsrc –s oracled is the command given to start the subsystem oracle daemon.

To modify records of the /etc/inittab file, commands used are:

Mkitab : will add new record (entry) in /etc/inittab

To add an entry in /etc/inittab file,

# mkitab <rule>

For eg:

# mkitab “cdrom : 2 : respawn : startsrc –d cdromd”

Chitab : will change the existing records in /etc/inittab

To change an entry in /etc/inittab file,

# chitab <rule>

For eg:

# chitab “cdrom : 3 : respawn : startsrc –s cdromd”

Rmitab : will remove the records from /etc/inittab

To change an entry in /etc/inittab file,

# rmitab <rule>

For eg:

# rmitab “cdrom : 3 : respawn : startsrc –s cdromd”

Lsitab : will list the records available in /etc/inittab

To list entries in /etc/inittab file,

# lsitab <rule>

For eg:

# lsitab “cdrom : 3 : respawn : startsrc –s cdromd”

Here’s a question, check whether the records listed by lsitab command is same as # cat /etc/inittab?

To identify current run level, command used is:

# cat /etc/init.state

OR

# who –r

Happy learning !

About these ads

Written by RA

March 11, 2012 at 1:17 am

Views

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

%d bloggers like this: