Go to the first, previous, next, last section, table of contents.

Why doesn't display-time show the load average in the mode line


In GNU Emacs 18.56, a change was made in the display-time code. Formerly, in version 18.55, Emacs used a program named `loadst' to notify Emacs of the change in time every minute. loadst also sent Emacs the system load average if it was installed with sufficient privilege to get that information (or was on a system where no such privilege was needed). Emacs then displayed this information in the mode line.

In version 18.56, this code was changed to use a program named `wakeup'. wakeup doesn't send Emacs any information, it's only purpose is to send Emacs *something* every minute, thus invoking the filter function in Emacs once a minute. The filter function in Emacs does all the work of finding the time, date, and load average. However, getting the load average requires the privilege to read kernel memory on most systems. Since giving Emacs this privilege would destroy any security a system might have, for almost everyone this is not an option. In addition, Emacs does not have the code built into it to get this information on the systems which have special system calls for this purpose, even though loadst had code for this.

The solution I use is to get the files lisp/display-time.el and etc/loadst.c from version 18.55 and use those with 18.58. (I have heard a rumor that loadst disappeared because of the legal action Unipress threatened against IBM.)

WARNING: Do not install Emacs setgid kmem unless you wish to destroy any security your system might have!!!!!!!!!!

If you are using Emacs 18.55 or earlier, or already using the solution I describe above, read further:

The most likely cause of the problem is that `loadst' can't read the special file /dev/kmem. To properly install loadst, it should be either setuid to the owner of /dev/kmem, or is should be setgid to the group to which /dev/kmem belongs. In either case, /dev/kmem should be readable by its owner or its group, respectively. Assuming the existence of a group named `kmem', here is an example of how to do this:

  chgrp kmem /dev/kmem
  chmod g+r /dev/kmem
  chgrp kmem /usr/local/emacs/etc/loadst
  chmod g+s /usr/local/emacs/etc/loadst

Another possibility is that your version of Unix doesn't have the load average data available in /dev/kmem. Your version of Unix might have a special system call to retrieve this information (eg., inq_stats under UMAX), and loadst might not have been enhanced to cope with this.

Go to the first, previous, next, last section, table of contents.