---
name: "utmpset"
section: "8"
platform: "linux"
package: "runit"
version: "2.2.0-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/utmpset"
---

# utmpset(8)

logout a line from utmp and wtmp file

## NAME

utmpset - logout a line from utmp and wtmp file

## SYNOPSIS

**utmpset** \[ **-w** \] *line*

## DESCRIPTION

The **utmpset** program modifies the user accounting database [**utmp**(5)](/utmp/5.md) and optionally [**wtmp**(5)](/wtmp/5.md) to indicate that the user on the terminal *line* has logged out.

Ordinary [**init**(8)](/init/8.md) processes handle utmp file records for local login accounting. The [**runit**(8)](/runit/8.md) program doesn't include code to update the utmp file, the [**getty**(8)](/getty/8.md) processes are handled the same as all other services.

To enable local login accounting, add **utmpset** to the [**getty**(8)](/getty/8.md) *finish* scripts, e.g.:

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

## OPTIONS

- **-w**

  wtmp. Additionally to the utmp file, write an empty record for *line* to the wtmp file.

## EXIT CODES

**utmpset** returns 111 on error, 1 on wrong usage, 0 in all other cases.

## SEE ALSO

[sv(8)](/sv/8.md), [runsv(8)](/runsv/8.md), [runit(8)](/runit/8.md), [runit-init(8)](/runit-init/8.md) [runsvdir(8)](/runsvdir/8.md), [runsvchdir(8)](/runsvchdir/8.md), [chpst(8)](/chpst/8.md), [svlogd(8)](/svlogd/8.md), [getty(8)](/getty/8.md)

http://smarden.org/runit/

## AUTHOR

Gerrit Pape \<pape@smarden.org\>
