Syntax for /etc/inittab
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 !

