ttyrun(8)
π ttyrun(8) β System Management Commands πΈ
β¨ NAME β¨
ttyrun β start a program if a specified terminal device is available π
π SYNOPSIS π
ttyrun [-V|--verbose] [-e|--exitstatus status] term program
[program_options]
ttyrun [-h|--help]
ttyrun [-v|--version]
π¦ DESCRIPTION π¦
Okay so picture this: ttyrun usually gets started during system initialization, and its whole vibe is preventing a respawn through the init(8) program when a terminal is not available. Iconic behavior, honestly. π
term is the name of the terminal device, and it's 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. Slay. β¨
If the terminal device cannot be opened, the behavior of ttyrun depends on the -e option:
- If the
-eoption has been specified,ttyrunexits with the specified return value, or - If the
-eoption has not been specified,ttyrunsleeps until it receives a signal that causes an exit. π
program is an absolute path to the program to be started by ttyrun, and program_options specify additional arguments. Depending on the program, arguments might be required. The variable %t in the program_options is resolved to the terminal device specified with term. No cap, that little %t is doing main character work. π«Ά
π OPTIONS π
-e,--exitstatusstatus β specifies an exit status that is returned when the terminal device is not available.statusmust be an integer in the range1to255. You can use this status value in an upstart job file to prevent respawning. π₯-V,--verboseβ displays syslog messages. π-h,--helpβ displays a short help text, then exits. π-v,--versionβ displays the version number ofttyrun, then exits. π
β RETURN VALUES β
ttyrun exits with one of the following return values to report an error condition:
1βttyrunhas been started with an argument that is not valid or required but missing.2βttyruncould open the file specified fortermbut the file is not a terminal device.3βttyruncould not start the specified program.
The return values 1 to 3 might also be returned when the -e option is used and the terminal device is not available.
4 - 255β the terminal device is not available and the-eoption specifies an exit status in this range.
Bestie, those ranges are literal, okay? 4 - 255 is giving very specific exit-status energy. π
π EXAMPLES π
πΈ inittab πΈ
To start /sbin/agetty on terminal device hvc1, specify:
h1:2345:respawn:/sbin/ttyrun hvc1 /sbin/agetty -L 9600 %t linux
π§ upstart job/event files π§
To start /sbin/agetty on terminal device hvc1, add the following settings to the job file:
respawn
normal exit 42
exec /sbin/ttyrun -e 42 hvc1 /sbin/agetty -L 9600 %t linux
With the normal exit statement, you specify an exit status that will prevent upstart from respawning the program. To prevent respawning with ttyrun, you must specify the same value for the -e option. Periodt. π
π SEE ALSO π
agetty(8), mingetty(8), inittab(5), events(5)
mwah π this little page comes from s390-tools, December 2011, and yes bestie, itβs ttyrun(8) β bye! π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: s390-tools 2.44.1-160000.1.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms