
NAME
ktd -- system accounting daemon

SYNOPSIS
/etc/ktd [ intvl [ num ] ]

DESCRIPTION
"ktd" is a background program intended to collect and save system
accounting information.  It reads /dev/kt to obtain the number of
1/60 seconds spent by the system in each of the modes:
(1) System
(2) User
(3) System Interrupt
(4) Idle

In addition, the number of 1/60 seconds that swapping is in  pro-
gress,  the  number  of 1/60 seconds that the RP04 is active, and
the number of RP04 transfers are kept.   "ktd"  also  counts  the
number  of  users logged in on (currently) three groups of termi-
nals:
(1) System terminals
(2) Technical typing
(3) Other terminals (students)

Normally, these values are sampled every minute and are  averaged
every  30  minutes.   The average is written to a file.  However,
the time between samples and the number of samples can be  speci-
fied  in  the  command  line  as the parameters "intvl" and "num"
(respectively).

When the requested number of samples have  been  averaged,  a  20
(decimal) byte record is written to the file /usr/adm/ktmp.  This
record has the following format:

struct {
        int timev[2];
        int cnt[NMON];
        int u_count[NUSR];
} sum;

where NMON is defined in /usr/sys/stats.h as the number of  moni-
tored  variables,  and  NUSR  is  defined  in  the "include" file
"dstruct.h" as the number  of  different  user  types  to  count.
"timev"  is  a two-word array containing the system time when the
record was written.

It is not necessary to start "ktd" with an  ampersand.   It  will
automatically create a child to run in the background with inter-
rupts and quits ignored.  In addition, if run by the  super-user,
it  will  clear  its terminal designation (via "clrtty") and will
"nice" itself to -5 to avoid being swapped out (unless absolutely
necessary).

FILES
/dev/kt         -- system statistics device
/etc/utmp       -- "who" file
/usr/adm/ktmp   -- output file


SEE ALSO
usg (VIII)

BUGS
Only one "ktd" can run at once since the filename is fixed.
