RUNGETTY(8)

πŸ’– RUNGETTY β€” the rungetty(8) situation πŸ’–

okay bestie, so you found yourself in section 8 of the Linux Programmer's Manual, which is where the system admin girlypops live. this one's about rungetty, and ngl she's kind of a legend: a minimal console getty that can run literally any process. any. one. πŸ’…


✨ NAME ✨

rungetty β€” a minimal console getty that can run any process πŸŽ€


🌸 SYNOPSIS 🌸

rungetty [--noclear] [--long-hostname] [-u username] [-g group] [-w
path] [-n priority] [--prompt [=string]] [-d n] [--autologin username]
tty [--] [command] [arguments]

πŸ¦‹ DESCRIPTION πŸ¦‹

So rungetty is a getty made for virtual consoles, and her whole thing β€” her main character energy, if you will β€” is that she can run any program, not just login(1). like, she's not gonna be pigeonholed.

She's based on mingetty(8), and just like her ancestor, rungetty is not suitable for serial use. fr fr. both the author and the author of mingetty(8) say: for serial stuff, go use mgetty(8) instead. 🫢

That said, she is super useful for keeping programs running at all times β€” think stuff like telnet(1), just vibing there forever. and here's the tea: when she runs a program that isn't login, it gets executed as the user and group nobody, or as the user given by username and the group given by group if you specified those. πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • --noclear β€” don't clear the screen before asking for the login name. (normally the screen does get cleared, so this is you saying "bestie leave my pixels alone") ✨
  • --long-hostname β€” by default the hostname only gets printed up until the first dot. with this on, you get the full text from gethostname() β€” the whole thing, no edits. 🌈
  • -u username β€” by default rungetty runs programs as nobody. with this, she runs them as the user username. slay. πŸŽ€
  • -g group β€” by default rungetty runs as the group nobody. this lets you tell her to run programs as the group group. πŸ’œ
  • --prompt [=string] β€” makes rungetty wait for user input (usually an Enter) before executing the program. if string is given, that's what gets displayed. otherwise you get a default prompt. πŸ“
  • -n n β€” the nice value of the specified program. 🧚
  • -w path β€” the working directory of the specified program. πŸ“
  • -d n β€” specifying -d makes rungetty wait n seconds before running the specified program. ⏳
  • --autologin username β€” logs the specified user onto the console (normally /dev/tty1) when the system is first booted, without prompting for a username or password. okay so here's the whole lore:
    • when the autologin option is supplied, rungetty checks that the controlling terminal is the console (normally /dev/tty1), that a reasonable username has been supplied, and that this is the first autologin request since the system booted.
    • if all of those conditions are met, a request for an unauthenticated login gets passed to the login program. otherwise, a normal interactive login happens instead.
    • the login program may deny the request for an unauthenticated login. typically this happens when the user is root, has a UID of 0, or whenever a normal interactive login would be denied due to the access restrictions specified in the nologin, usertty, or securetty files.
    • only a single autologin request will be issued after a system boot. if the automated login request is denied, or if the user logs out, rungetty reverts to performing normal interactive logins for all subsequent login requests. no second chances, periodt. 😭
  • -- β€” tells rungetty there are no more options to parse. useful for passing arguments with a - in them to the external program. πŸ™ˆ

πŸ‘‘ ARGUMENTS πŸ‘‘

  • tty β€” name of the tty to run on.
  • command β€” runs the specified command. she searches for command in /bin, /usr/bin, /usr/ucb, /usr/local/bin if the complete pathname and filename aren't given. πŸ”
  • [arguments] β€” command line arguments to pass to command.

πŸŽ€ ISSUE ESCAPES πŸŽ€

rungetty recognizes these escape sequences, which might be embedded in the /etc/issue file. little magic spells, basically ✨

  • \d β€” insert current day (localtime),
  • \l β€” insert line on which rungetty is running,
  • \m β€” inserts machine architecture (uname -m),
  • \n β€” inserts machine's network node hostname (uname -n),
  • \o β€” inserts domain name,
  • \r β€” inserts operating system release (uname -r),
  • \t β€” insert current time (localtime),
  • \s β€” inserts operating system name,
  • \u resp. \U β€” the current number of users which are currently logged in. \U inserts "n users", whereas \u only inserts "n".
  • \v β€” inserts operating system version (uname -v).

πŸ”₯ EXAMPLE πŸ”₯

in /etc/inittab, these lines:

r1:12345:respawn:/sbin/rungetty tty1
r2:2345:respawn:/sbin/rungetty tty2 telnet mail.foo.com
r3:2345:respawn:/sbin/rungetty tty3 -u support top
r4:2345:respawn:/sbin/rungetty tty4 -n 20 -w /etc rc5des

Would run a local login on /dev/tty1, a telnet(1) session to mail.foo.com on /dev/tty2, and top(5) on /dev/tty3. Note that telnet(1) is run as user nobody, while top(5) is run as user support, and start the program rc5des(5) at the lowest priority level with a current directory of /etc. πŸ¦‹ look at her go!!


🧚 FILES 🧚

/etc/issue, /var/run/utmp, /var/log/autologin.


πŸ’Œ BUG REPORTS πŸ’Œ

Please send all bug reports to jake@nodomainname.net.


πŸ’€ BUGS πŸ’€

There are no known bugs.

(iconic behaviour honestly, we love a flawless queen 🌸)


🌈 SEE ALSO 🌈

mingetty(8), mgetty(8).


πŸ’– AUTHOR πŸ’–

Copyright Β© 1999 Jakob Kaivo <jake@nodomainname.net>.


and that's the whole page bestie!! written by Jakob 'sparky' Kaivo on 04 February 1999, living in the RUNGETTY(8) corner of the Linux Programmer's Manual. go keep some weird program alive on a tty, you absolute legend πŸ’…πŸ«Άβœ¨