[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 3

mkitab Command

Purpose

Makes records in the /etc/inittab file.

Syntax

mkitab [ -i Identifier ] { [ Identifier ] : [ RunLevel ] : [ Action ] : [ Command ] }

Description

The mkitab command adds a record to the /etc/inittab file. The Identifier:RunLevel:Action:Command parameter string specifies the new entry to the /etc/inittab file. You can insert a record after a specific record using the -i Identifier flag. The command finds the field specified by the Identifier parameter and inserts the new record after the one identified by the -i Identifier flag.

Parameters

The Identifier:RunLevel:Action:Command parameter string specifies the record in the /etc/inittab file, as follows:

Identifier A 14-character parameter that uniquely identifies an object. The Identifier must be unique. If the Identifier is not unique, the command is unsuccessful. The Identifier cannot be changed; if you try to change it, the command is unsuccessful.
RunLevel A 20-character parameter defining the run levels in which the Identifier can be processed. Each process started by the init command can be assigned one or more run levels in which it can be started.
Action A 20-character parameter that informs the init command how to process the Command parameter that you specify. The init command recognizes the following actions:
respawn If the process identified in this record does not exist, start the process. If the process currently exists, do nothing and continue scanning the /etc/inittab file.
wait When the init command enters the run level specified for this record, start the process and wait for it to stop. While the init command is in the same run level, all subsequent reads of the /etc/inittab file ignore this object.
once When the init command enters the run level specified for this record, start the process, do not wait for it to stop and when it does stop do not restart the process. If the system enters a new run level while the process is running, the process is not restarted.
boot Read this record only when the system boots and reads the /etc/inittab file. The init command starts the process. Do not wait for the process to stop and when it does stop, do not restart the process. The run level for this process should be the default, or it must match the run level specified by the init command at startup time.
bootwait Read this record only when the system boots and reads the /etc/inittab file. The init command starts the process. Wait for it to stop, and when it does stop, do not restart the process.
powerfail Start the process identified in this record only when the init command receives a SIGPWR power fail signal.
powerwait Start the process identified in this record only when the init command receives a SIGPWR power fail signal, and wait until it stops before continuing to process the /etc/inittab file.
off If the process identified in this record is currently running, send the warning signal SIGTERM and wait 20 seconds before sending the SIGKILL kill signal. If the process is nonexistent, ignore this line.
hold When the process identified in this record is terminated, do not start a new one. The hold action can only be activated by the phold command.
ondemand Functionally identical to respawn. If the process identified in this record does not exist, start the process. If the process currently exists, do nothing and continue scanning the /etc/inittab file. Specify this action to perform the respawn action when using a, b, or c run levels.
initdefault A line with this action is processed only when the init command is originally invoked. The init command uses this line to determine which run level to originally enter. The command does this by taking the highest run level specified in the RunLevel parameter and using that as the command's initial state. If the RunLevel parameter is empty, its value is interpreted as 0123456789, and the init command enters a run level of 9. If the init command does not find an initdefault line in the inittab file, it requests an initial run level from the operator at initial program load (IPL) time.
sysinit Start the process identified in this record before the init command tries to access the console. For example, you might use this to initialize devices.
Attention: To avoid possible corruption of system files, the stdin, stdout, and stderr files must be specified in the Command parameter with redirection, or they must be explicitly opened by the program being run by the command line.
Command A 1024-character field specifying the shell command.

Flags

-i Identifier Specifies which record in the /etc/inittab file the new record follows.

Examples

  1. To add a new record to the /etc/inittab file, telling the init command to handle a login on tty2, enter:
    mkitab "tty002:2:respawn:/usr/sbin/getty /dev/tty2"
  2. To add a new record to the /etc/inittab file, telling the init command to execute the /etc/rc.tcpip file after the /usr/sbin/srcmstr file is started, enter:
    mkitab -i srcmstr "rctcpip:2:wait:/etc/rc.tcpip > /dev/console"
  3. To add a new record to the /etc/inittab file, telling the init command to execute the /etc/rc file and send its output to the boot log, enter:
    mkitab ((rc:2:wait:/etc/rc 2>&1 | alog -tboot > /dev/console))

Files

/etc/inittab/ Contains the mkitab command.

Related Information

The chitab command, lsitab command, rmitab command, init command.


[ Previous | Next | Contents | Glossary | Home | Search ]