Problem
When I run the who(C) command on my system, it returns this error:
who: Error --- entry has ut_type of <num> when maximum is 9where the value of <num> can be any number higher than 9, for example, '12336'.
Cause
who(C) checks the entries in /etc/utmp and/or /etc/utmpx.
One of the entries is a variable called ut_type. This variable
is documented in the reference manual for utmp(F) as being of
type short. Further down the manual page you will see ut_type
can take a set of defined values, ranging from 0 to UTMAXTYPE,
where "UTMAXTYPE" is set to the value '9'. Thus, the maximum
value ut_type can have is '9'. Solution
The error message indicates that who(C) has found an entry in
either utmp or utmpx for ut_type that exceeds the defined maximum
value of '9'. It is likely that either, or both, /etc/utmp or
/etc/utmpx have become corrupted. What has caused this corruption
will need to be investigated if the corruption continues to occur.A simple solution for removing the reported error message is to
remove or zero out both the /etc/utmp and /etc/utmpx files right
before shutting down. These will be rebuilt again when the system
is rebooted.NOTE: /etc/wtmpx, which contains login history, can be truncated whilst the
server is in multi-user mode. Use who -x /etc/wtmpx to view this
information.