Ed Schouten c21ae3a403 Move utmpx handling out of init(8).
This has the following advantages:

- During boot, the BOOT_TIME record is now written right after the file
  systems become writable, but before users are allowed to log in. This
  means that they can't cause `hidden logins' by logging in right before
  init(8) kicks in.

- The pututxline(3) function may potentially block on file locking,
  though this is very rare to occur. By placing it in an rc script, the
  user can still kill it with ^C if needed.

- Most importantly: jails don't use init(8). This means that a force
  reboot of a system running jails will leave stale entries in the
  accounting database of the jails individually.
2012-02-11 20:47:16 +00:00

19 lines
221 B
Bash
Executable File

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: utx
# REQUIRE: DAEMON cleanvar
# BEFORE: LOGIN
# KEYWORD: shutdown
. /etc/rc.subr
name="utx"
start_cmd="utx boot"
stop_cmd="utx shutdown"
load_rc_config $name
run_rc_command "$1"