|
The /etc/inittab file is composed of entries that
are position-dependent and have the following format: Identifier:RunLevel:Action:Command
The
colon character (:) is used as a delimiter. To comment out an entry
in the /etc/inittab file, add : or # at the beginning
of the entry.
Example: The following entry is commented
out. :Identifer:RunLevel:Action:Command
Each
entry is delimited by a newline character. A backslash (\) character
preceding a newline character indicates the continuation of an entry.
There are no limits on the number of entries in the /etc/inittab file.
The maximum entry size is 1024 characters. The entry fields are: - Identifier
- A string of 1 to 7 characters that uniquely identifies the entry.
The ID is used as the job name for the process.
- The identifier must start in column 1 of the file.
- Valid characters are A-Z and 0-9. Lowercase characters are converted
to uppercase.
- The identifier must start with an alphabetic character.
The identifier is required; there is no default.
- RunLevel
- Not supported on z/OS® UNIX. Identifies the run levels
in which this entry can be processed. Even though the RunLevel field
is not supported, it is in the inittab entry for compatibility with
other UNIX implementations.
The run level field can be up to 32 alphanumeric characters. If it
is specified, it will be checked for validity and the inittab entry
will be skipped if it is in error.
- Action
- Specifies how to handle the process that is started in the command
field. The supported actions are:
- once
- Starts the process and does not wait for it to end. Continues
scanning the /etc/inittab file and processes the next entry.
When it ends, the process is not restarted.
- respawn
- Starts the process and does not wait for it to end. Continues
scanning the /etc/inittab file and processes the next entry.
The process is restarted when it ends. When a process is spawned
again, it is restarted with the same file descriptors and environment
variables that it was started with originally.
If a process ends
due to a shutdown of all fork activity, the process is not restarted
until fork activity is re-enabled. If a respawnable process ends and
then ends again after being restarted within 15 minutes of its first
ending, then message BPXI082D is displayed. The message identifies
the process entry and asks whether to try again or ignore the error.
A process identified for respawn will not be able to register as a
permanent process that can survive a shutdown and restart cycle because
the /etc/inittab file will be processed again during restart.
Restriction: Daemons,
such as cron, inetd, and sshd (the
OpenSSH daemon), cannot be restarted using the respawn attribute.
These processes fork themselves. The respawn attribute is associated
with the parent process that is started, not the forked child processes.
To
check the status of the respawn attribute, issue the D OMVS operator
command and check the STATE field. You can also use the -o
attr option of the ps shell command, which displays
the process attributes.
Tip: To
avoid excessive consumption of common storage, limit the number of
processes started with the respawn attribute to 100 or fewer.
- respfrk
- Starts the process and does not wait for it to end. Continues
scanning the /etc/inittab file and processes the next entry.
- If the process never issues a fork command, then this action behaves
the same way as the respawn action.
- If the process issues a fork, then the respawn attribute is transferred
to the forked child process. When the child process ends, the original
parent process is spawned. This process will fork itself, thus restarting
the daemon process.
- If the original process issues any additional forks, the respawn
attribute is not transferred to those forked children. It is only
transferred the first time the fork is issued.
The respfrk option is intended for a program
that forks itself to create a child process which then continues running
while the parent process ends. For example, the cron and inetd daemons
are written this way. This option is not found on any other UNIX platforms.
Restriction: Daemons such as the OpenSSH daemon cannot
be respawned with the respfrk attribute. The OpenSSH
daemon also forks itself to create a child process which then continues
running while the parent process ends. However, it does additional
forks before actually forking the daemon process.
- wait
- Starts the process and waits for it to end. The process is not
restarted when it ends. Any subsequent /etc/inittab entries
are not processed until this process ends.
- Command
- Identifies a shell command, script, or executable program to be
run. The name must be a fully qualified path name. The entire command
is, by default, executed by the shell as:
/bin/sh -c "exec command"
You
can change the path name of the target shell via the -sh option
in the /etc/init.options file, but if respawn is required,
this action is not suggested.
Tip: You
might see a message indicating that an inittab entry was started successfully
although the command might not have run successfully. This is the
case if the syntax of the inittab entry was correct but the command
path was not a valid path name.
|