UTX(8)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ‘‘ UTX(8) β€” the user accounting database glow-up πŸ’…

okay so bestie, listen: this is the manual page for utx, the system manager's manual entry, and it's literally your little helper for doing operations on the user accounting database β€” the same kind of stuff pututxline(3) does behind the scenes. no cap, it's giving "backstage pass to who's logged in" energy. ✨


🌸 SYNOPSIS 🌸

utx boot
utx shutdown
utx rm identifier ...

three whole moods, that's it, that's the tool πŸŽ€


πŸ’– DESCRIPTION πŸ’–

so the utx utility lets you perform operations on the user accounting database, exactly like pututxline(3) does. iconic behavior honestly.

the first argument you pass tells it which action to run, and there are three:

  • boot β€” writes a boot time record to the user accounting database. lowkey this one should typically only be used by rc(8), so like… don't just vibe your way in there 🫢
  • shutdown β€” writes a shutdown time record to the user accounting database. same deal, this should typically only be used by rc(8). it's their moment, let them have it πŸ’…
  • rm β€” removes stale sessions from the user accounting database by referring to their identifier. stale sessions can happen if a login service exits prematurely or just fails to remove the session from the accounting database β€” messy, we've all been there 😭

πŸ¦‹ the whole rm situation, explained πŸ¦‹

tools like w(1) will not display the identifier that corresponds with a login session, because its value is typically only of use by the process managing the record. so like, it's a secret little name tag only the record's manager cares about πŸ™ˆ

good news: the following command gets you all the records from the user accounting database's active session table, including their identifiers:

getent utmpx active

and for the identifiers themselves? you've got options, bestie:

  • you can supply them in hexadecimal form, exactly as displayed by getent(1), or
  • as a string, if the identifier allows such a representation ✨

⭐ the very important permission check ⭐

because this utility requires write-access to the user accounting database, its use is limited to the super-user. yes, this is a root-only situation, main character privilege, no cap πŸ‘‘

for real though β€” that's a genuine restriction, not a vibe. if you're not the super-user, this is not your moment πŸ’€

🧚 SEE ALSO 🧚

go read those too, iykyk πŸ“š


🌈 HISTORY 🌈

the utx utility replaced utxrm in FreeBSD 10.0. glow-up of the century, honestly πŸŽ€


πŸ“ AUTHORS πŸ“

  • Ed Schouten <ed@FreeBSD.org> β€” the icon behind it all πŸ‘‘

and that's the whole page bestie!! this one's from the Debian gang, dated November 3, 2013, and it's the UTX(8) system manager's manual entry β€” periodt. go forth and manage those records responsibly πŸ’œβœ¨

πŸ“¦ where this page comes from