ttyrun(8)

πŸ“¦ version 2.44.1, in opensuse-leap 16.0

πŸ’– 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 -e option has been specified, ttyrun exits with the specified return value, or
  • If the -e option has not been specified, ttyrun sleeps 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, --exitstatus status β€” specifies an exit status that is returned when the terminal device is not available. status must be an integer in the range 1 to 255. 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 of ttyrun, then exits. 🌈

⭐ RETURN VALUES ⭐

ttyrun exits with one of the following return values to report an error condition:

  • 1 β€” ttyrun has been started with an argument that is not valid or required but missing.
  • 2 β€” ttyrun could open the file specified for term but the file is not a terminal device.
  • 3 β€” ttyrun could 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 -e option 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