Name

login-update-utmpx, utx — update the login log and active login table

Synopsis

login-update-utmpx { boot | reboot | shutdown }

utx { boot | reboot | shutdown }

Description

login-update-utmpx updates the utmpx(3) login log and active login table.

  • Invoked with the boot or reboot subcommands, it writes a new BOOT_TIME entry. This is designed to be invoked at system bootstrap before any login services are started. login-update-utmpx creates the files for the login log and the active login table if they do not already exist. The entry can be later read with who -b or last reboot .

  • Invoked with the shutdown subcommand, it writes a new SHUTDOWN_TIME entry. This is designed to be invoked at system shutdown after all login services have been stopped. The entry can be later read with last reboot . (On Linux operating systems, which do not have SHUTDOWN_TIME, the entry is a fake RUN_LVL entry that can be later read with who -r .)

On operating systems such as FreeBSD, note that login-update-utmpx always erases all entries from the active login table, as an effect of the pututmpx(3) library function.

Compatibility

For compatibility with the FreeBSD utx(8) command, this command is also available as utx. Its primary use is in services that run at startup and shutdown, so it does not duplicate that command's rm subcommand.

Author

Jonathan de Boyne Pollard