utmpset(8)

πŸ“¦
version 2.3.1 Β· 2 versions
, in alpine 3.24, nixpkgs unstable, ubuntu resolute, ubuntu stonking

✨ utmpset β€” the logout glow-up ✨

ok bestie, welcome to the utmpset(8) page πŸ’– she's a tiny little System Manager's Manual darling and she has ONE job: she logs you out of the accounting books. let's get into it.


πŸŽ€ NAME πŸŽ€

utmpset β€” logout a line from utmp and wtmp file


πŸ¦‹ SYNOPSIS πŸ¦‹

utmpset [ -w ] line

like. that's it. that's the whole summoning ritual. one little line and optionally a -w and you're done πŸ’…


🌸 DESCRIPTION 🌸

so the utmpset program modifies the user accounting database utmp(5) β€” and optionally wtmp(5) β€” to indicate that the user on the terminal line has logged out. that's the whole vibe. it's giving "closing the tab on your session" 🫢

ordinary init(8) processes handle utmp file records for local login accounting. but the runit(8) program? she doesn't include code to update the utmp file, so the getty(8) processes are handled the same as all other services. no special treatment, no favorites, everyone's equal in the runit household 😌

so if you want local login accounting to actually work, you gotta add utmpset to the getty(8) finish scripts. for example, bestie:

$ cat /service/getty-5/finish
#!/bin/sh
exec utmpset -w tty5
$

iconic. that's the whole setup. finish script runs, utmpset does its little thing, accounting stays cute πŸ’–


✨ OPTIONS ✨

  • -w β€” wtmp. additionally to the utmp file, write an empty record for line to the wtmp file. so like, utmp gets the update, and wtmp gets an empty record too. two files, one flag, no cap πŸŽ€

πŸ”₯ EXIT CODES πŸ”₯

ngl these are specific and you should know them:

  • utmpset returns 111 on error 😭
  • 1 on wrong usage πŸ™ˆ
  • 0 in all other cases πŸ‘‘

🌈 SEE ALSO 🌈

go read these next, they're all part of the family fr fr:

and if you wanna go deeper (main character energy tbh):


πŸ’œ AUTHOR πŸ’œ

Gerrit Pape <pape@smarden.org>


and that's the page bestie!! utmpset(8) β€” straight out of the System Manager's Manual, living on smarden.org/runit, written by Gerrit Pape, and she said what she said πŸ’…βœ¨ you're welcome, go log out responsibly πŸ¦‹

πŸ“¦ where this page comes from