Friday, 26 April 2013

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.

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

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

2. To add an entry in /etc/inittab file,

# mkitab <rule>
For eg:
# mkitab “cdrom : 2 : respawn : startsrc –d cdromd”

3. To change an entry in /etc/inittab file,

chitab : will change the existing records in /etc/inittab
# chitab <rule>
For eg:
# chitab “cdrom : 3 : respawn : startsrc –s cdromd”
rmitab : will remove the records from /etc/inittab

4. To Remove 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

5. To list entries in /etc/inittab file,

# lsitab <rule>
For eg:
# lsitab “cdrom : 3 : respawn : startsrc –s cdromd”

6.Here’s a question, check whether the records listed by lsitab command is same as 

# cat /etc/inittab?
A:Yes

7. To identify current run level, command used is:

# cat /etc/init.state
OR
# who –r

0 blogger-disqus:

Post a comment