Technical article 104895

idleout(ADM) error "kill [-s signal_name | -signal_num | -signal_name] pid..."

OpenServer 5.0.0

Written · Last revised

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.

From the Xinuos technical article database, record 104895. Reproduced with permission. The original is at www.sco.com/ta/104895, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.