[comp.emacs] load won't display in Gnu Emacs

dd@beta.lanl.gov (Dan Davison) (04/21/89)

I tried this once before and didn't get an answer, so here goes again.

We have Gnu 18.53 under SOS (Sun OS) 4.0.1.  When users invoke
display-time, the modeline says "time and load" briefly, then displays
only the time.  If the superuser runs Gnu it *does* display the time
and load.

What's wrong?  Is there something obvious I've missed?

Thanks in advance,

dan davison/theoretical biology/t-10 ms k710/los alamos national laboratory
los alamos, nm 875545/dd@lanl.gov (arpa)/dd@lanl.uucp(new)/..cmcl2!lanl!dd

-- 
dan davison/theoretical biology/t-10 ms k710/los alamos national laboratory
los alamos, nm 875545/dd@lanl.gov (arpa)/dd@lanl.uucp(new)/..cmcl2!lanl!dd

gangolli@wolvesden.Stanford.EDU (Anil R. Gangolli) (04/21/89)

In article <24241@beta.lanl.gov> dd@beta.lanl.gov (Dan Davison) writes:
  >I tried this once before and didn't get an answer, so here goes again.
  >
  >We have Gnu 18.53 under SOS (Sun OS) 4.0.1.  When users invoke
  >display-time, the modeline says "time and load" briefly, then displays
  >only the time.  If the superuser runs Gnu it *does* display the time
  >and load.
  >
  >What's wrong?  Is there something obvious I've missed?


In the emacs etc library, the program loadst that gets the 
load info for display-time needs to have access to kernel
memory (/dev/kmem).  To give it this access:
	1) become superuser
	2) use chgrp to put loadst 
	   in the group kmem (this should be the group to which the file
	   /dev/kmem belongs).
	3) Then do "chmod g+s loadst".  This says,
	   when loadst runs, it will run with the access priveleges of
	   its group, which you've just set to be kmem.

Now things should work for non-superusers too.
--anil.

dsill@RELAY.NSWC.NAVY.MIL (04/21/89)

etc/loadst needs to be able to read /dev/kmem, which, of course, it
has no trouble doing when it's run by the superuser.  To make it work
for the plebes, change the group on loadst to the group of /dev/kmem
(which should have read access) and set the set-group-id bit of loadst
using chmod.

-Dave

shirono@hcx3.SSD.HARRIS.COM (04/21/89)

**>  comp.emacs  dd@beta.lanl.gov  Apr 20, 1989  <**
> We have Gnu 18.53 under SOS (Sun OS) 4.0.1.  When users invoke
> display-time, the modeline says "time and load" briefly, then displays
> only the time.  If the superuser runs Gnu it *does* display the time
> and load.

The clue is your last sentence.  display-time runs $EMACS/etc/loadst as a
sub-process to obtain the "time and load" information.  loadst, in turn,
reads /dev/kmem to obtain the load average.  As always, root has access,
but it seems nobody else has.  This is likely to be due to loadst not
having the right permissions.  In most cases, all that is needed is that
loadst be setgid kmem.

--Roberto
______________________________________________________________________________
                               ||   Internet: shirono@ssd.harris.com
     Roberto Shironoshita      ||
      Harris Corporation       ||             ...!novavax---\
   Computer Systems Division   ||   UUCP:     ...!uunet-------!hcx1!shirono
                               ||             ...!mit-eddie-/
------------------------------------------------------------------------------
DISCLAIMER: The opinions expressed here are my own; they in no way reflect the
            opinion or policies of Harris Corporation.

ecphssrw@robin.csun.edu (Stephen Walton) (04/29/89)

The difficulty with display-time is that it shows the output of the
program $emacs/etc/loadst, which reads /dev/kmem.  Under 4.2+ BSD and
similar Sun/OS releases, /dev/kmem became mode 640, owned by user root
and group kmem, as a security feature.  So, loadst must either be
changed to not read /dev/kmem, or (as we've done here) installed as
setgid kmem.
--
Stephen Walton, Dept. of Physics & Astronomy, Cal State Univ. Northridge
RCKG01M@CALSTATE.BITNET       ecphssrw@afws.csun.edu
swalton@solar.stanford.edu    ...!csun!afws.csun.edu!ecphssrw