login-monitor-active 1 user commands nosh
login-monitor-active start/stop user manager and runtime services for active login sessions
`login-monitor-active` --verbose --active-file `activefile` --target-prefix `string` --manager-prefix `string` --runtime-prefix `string`

## Description

`login-monitor-active` automatically runs system-control 1 to reset/stop user manager and runtime services as users are inserted into/deleted from the active logins table in the login database. It loops forever, monitoring the state of the active logins table file with kevent 2 waiting for it to be modified.

Renaming or unlinking the file requires restarting `login-monitor-active`.

When a new user appears in the active logins table, not already logged in, `login-monitor-active` issues a reset to start/stop the `user@username`, `user-services@username`, and `user-runtime@username` target and services (respectively) for the user. The prefixes in front of username can be changed with the --target-prefix, --manager-prefix, and --runtime-prefix command-line options. When the last login record for a user disappears, `login-monitor-active` issues a stop to unconditionally stop those.

Where the file is varies by operating system. On FreeBSD, it is `/var/run/utx.active`, for example. The getutxent 3 manual page usually gives the location. The --active-file command-line option forces the use of `activefile` instead, if this is supported by the C runtime library.

If the services do not exist, it makes no attempt to create them. All such services for all users should be enabled and disabled in the usual way, and reset will respect that.

## See also

ttylogin-starter 4

  auto-starter for login services that enable users to log-on in the first place

## Author

Jonathan de Boyne Pollard