[  Previous  |
Next  |
Contents  |
Glossary  |
Home  |
Search  ]
AIX Version 4.3 System Management Guide: Operating System and Devices
Changing the /etc/inittab File
In some cases, you may need to add, change, list, and remove records in the /etc/inittab file. The /etc/inittab file defines which processes to start at each run level. When you run the init command, it reads the records in the /etc/inittab file. Each record defines a run level for a specific process and contains four parameters:
| Identifier | 
  Identifies unique objects in one to fourteen characters. | 
| Run Level | 
  Defines the run levels in which the object can be processed in one to twenty characters. | 
| Action | 
  Defines what action the init command should take for this process. The following actions can be specified: respawn, wait, once, boot, bootwait, powerfail, powerwait, off, hold, ondemand, initdefault, and sysinit. | 
| Command | 
  Contains the shell command to be executed. | 
The following commands are the only supported method for modifying the records in the /etc/inittab file:
| chitab | 
  Changes records in the /etc/inittab file. | 
| lsitab | 
  Lists records in the /etc/inittab file. | 
| mkitab | 
  Adds records to the /etc/inittab file. | 
| rmitab | 
  Removes records from the /etc/inittab file. | 
Adding Records
To add a record to the /etc/inittab file, type mkitab 
Identifier
:
Run Level
:
Action
:
Command
 and press the Enter key.
For example, to add a record for tty2, type:
mkitab tty002:2:respawn:/usr/sbin/getty /dev/tty2
In the above example:
| tty002 | 
  Identifies the object whose run level you are defining. | 
| 2 | 
  Specifies the run level at which this process should run. | 
| respawn | 
  Specifies the action that the init command should take for this process. | 
| /usr/sbin/getty /dev/tty2 | 
  Specifies the shell command to be executed. | 
Changing Records
To change a record to the /etc/inittab file, type chitab 
Identifier
:
Run Level
:
Action
:
Command
 and press the Enter key.
For example, to change a record for tty2 so that this process runs at run levels 2 and 3, type:
chitab tty002:23:respawn:/usr/sbin/getty /dev/tty2
In the above example:
| tty002 | 
  Identifies the object whose run level you are defining. | 
| 23 | 
  Specifies the run levels at which this process should run. | 
| respawn | 
  Specifies the action that the init command should take for this process. | 
| /usr/sbin/getty /dev/tty2 | 
  Specifies the shell command to be executed. | 
Listing Records
To list records in the /etc/inittab file:
- To list all records, type lsitab -a
 and press the Enter key.
 
- To list a specific record, type lsitab 
Identifier
 and press the Enter key.
 
For example, to list the record for tty2, type lsitab tty2
 and press the Enter key.
Removing Records
To remove a record from the /etc/inittab file, type rmitab 
Identifier
 and press the Enter key. For example, to remove the record for tty2, type rmitab tty2
 and press the Enter key.
[  Previous  |
Next  |
Contents  |
Glossary  |
Home  |
Search  ]