Problem
I would like to use idleout(ADM) on my system to log out idle
users. When I issue the idleout(ADM) command, I get this message:kill [-s signal_name | -signal_num | -signal_name] pid...
kill -l [exit_status]This message is then redisplayed at regular intervals.
Cause
idleout(ADM) uses awk(C) to build a list of processes that need to be killed. This list is passed to kill(C) so that the list of idle processes may be killed. If this list is empty, then kill(C) will report the error:
kill [-s signal_name | -signal_num | -signal_name] pid...
kill -l [exit_status]This kill(C) behavior is conformant with ISO/IEC DIS 9945-2:1992.
Solution
SCO is aware of this problem and is working to resolve it. It is scheduled to be fixed in a future release of the operating system.
An interim solution is provided below. Using your favorite editor,
edit /usr/bin/idleout and modify the killer() function which
reads as:killer() {
TMPFILE=/tmp/kill$$
who -u > $TMPFILE
kill -9 `awk ' \
$6 == "." { 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 `
rm $TMPFILE
}so that it reads as:killer() {
TMPFILE=/tmp/kill$$
who -u > $TMPFILE
LIST=`awk ' \
$6 == "." { 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 `
[ -z "$LIST" ] || kill -9 $LIST
rm $TMPFILE
}Note: This modification will only issue the kill -9 command if there are processes to kill.