The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Daemon::Shutdown::Monitor::who - a who specific monitor

SYNOPSIS

Monitor users logged in with 'who'

DESCRIPTION

Tests if any users are logged in (using the 'who' command). When no users are logged in the flag "trigger_pending" is set. If a further "trigger_time" seconds pass and there are still no users logged in the trigger is sent back to the parent process (return 1).

METHODS

new

loop_sleep <Int>

How long to sleep between each test

Default: 60 (1 minute)

trigger_time <Int>

The time to wait after discovering that no users are currently logged in

Default: 360 (10 minutes)

user <Str>

Monitor only a specific user.

Default: undef

Example configuration

monitor: who: trigger_time: 1800 user: rclarke loop_sleep: 1

run

Run the who Monitor

AUTHOR

Robin Clarke, perl at robinclarke.net

LICENSE AND COPYRIGHT

Copyright 2015 Robin Clarke.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.