Start of change

ttyrun - start a program if a specified terminal device is available

As of s390-tools 1.9 (kernel 2.6.34), the ttyrun program can run on target systems to start a program on a terminal device; for example, a getty program.

ttyrun is typically started during the system startup procedures and is used to prevent a respawn through the system startup procedures when a terminal is not available.

Format

Read syntax diagramSkip visual syntax diagram
ttyrun syntax

>>-ttyrun--+-----+--+--------------+-- <term>-- <prog>--+-----------------+-><
           '- -V-'  '- -e <status>-'                    '- <prog_options>-'   

where:
-V or --verbose
displays syslog messages.
-e <status> or --exitstatus <status>
specifies an exit status that is returned when the terminal device is not available. The exit status must be an integer in the range 1 - 255.

You can use this status value in an Upstart job file to prevent respawning.

  • With the -e option, ttyrun exits with the specified return value.
  • Without the -e option, ttyrun sleeps until it receives a signal that causes an exit.
<term>
specifies the name of the terminal device and is a path relative to the /dev directory; for example, specify hvc0 for /dev/hvc0. If the specified terminal device can be opened, ttyrun starts the specified program.
<prog>
specifies an absolute path to the program to be started by ttyrun.
<prog_options>
specifies arguments for the program to be started by ttyrun. Depending on the program, some arguments might be required. In the arguments, you can use %t as a variable that resolves to the specified terminal device.
-v or --version
displays the version number of ttyrun and exits.
-h or --help
displays a short help text and exits. For more detail, see the ttyrun man page.

ttyrun return values

ttyrun exits with one of the following return values to report an error condition:
1
ttyrun was called with an argument that is not valid or required but missing.
2
the <term> variable specifies a device that is not a terminal device.
3
ttyrun failed to start the specified program.

Do not inadvertently override these return values with the -e option.

4 - 255
The terminal device is not available and the -e option specifies an exit status in this range.
Start of change

systemd example

End of change

inittab example

Upstart example

End of change