Problem
Normally any user, including root, will be logged out after the
"idleout" time defined in /etc/default/idleout has expired for
that user's login. However, some environments require that a user
or users not be logged out when idleout has expired.NOTE: The idleout command is not enabled by default. Solution
The System Administrator will need to edit /usr/bin/idleout to exclude any users that are not to be logged out when idleout expires.
Note: Before editing /usr/bin/idleout, copy that file to /usr/bin/idleout.out.
As an example, if two users, root, and a user, nonroot, are to be excluded from being logged out by idleout, edit /usr/bin/idleout at the line (approximately line 183):
$6 == "." { next } \so that it reads:$6 == "." || ( $1 == "root" ) || ( $1 == "nonroot" ) { next }\In this example, after editing that line the "killer" function should read:
killer() {
TMPFILE=/tmp/kill$$
LANG=C who -u > $TMPFILE
pids=`awk ' \
$6 == "." || ( $1 == "root" ) || ( $1 == "nonroot") { next
}\
$6 == "old" { print $7 ; next } \
{ i=index($6,":"); \
x=substr($6,1,i-1); \
y=substr($6,i+1,length($6)-i); \
} \
x > h { print $7 ; next } \
x == h && y+0 >= m+0 { print $7 ; next } \
' h=$1 m=$2 $TMPFILE `
[ -n "$pids" ] && kill -9 $pids
rm $TMPFILE
}Note: In the above function and throughout /usr/bin/idleout, the characters "\" are important and must not be removed.
To enable idleout, either run /usr/bin/idleout from the command line as root for a single instance, or modify /etc/rc2.d/S88USRDEFINE with a new line:
/usr/bin/idleoutThis enables idleout when the system is running in multiuser mode.
NOTE: An unsupported "super-idleout" ksh script that is configurable can
be found at:ftp://ftp.armory.com./pub/admin/nidleout See also
The /etc/default/idleout file.man idleout(ADM), getut(S), kill(S), who(C)