From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,b694d830c48cbe06 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-05-05 06:41:30 PST Newsgroups: comp.unix.osf.osf1 Path: gmd.de!nntp.gmd.de!xlink.net!howland.reston.ans.net!agate!msuinfo!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!marlin.jcu.edu.au!coral.cs.jcu.edu.au!stuart From: stuart@coral.cs.jcu.edu.au (Stuart Kemp) Subject: Re: How do I get rid of these idle entries? Message-ID: Sender: news@marlin.jcu.edu.au (USENET News System) Organization: James Cook University References: <2pjpsv$p0q@pdq.coe.montana.edu> Date: 5 May 94 03:31:55 GMT In <2pjpsv$p0q@pdq.coe.montana.edu> osyjm@cs.montana.edu (Jaye Mathisen) writes: >I don't like these idle 8000+ days crap... What's the proper solution? >13:25 up 2 days, 17 mins, 21 users, load average: 0.20, 0.06, 0.07 >User tty from login@ idle JCPU PCPU what >sandy 0q 12:57 18 1 -csh >venky 0e 13:23 trn >starkey p6 aji 14:15 6 29 2 trn -xms >starkey aji 14:15 8882days - >harkin pa sente 07:58 4 12 1 -csh You don't easily get rid of them ... rather there is a bug in the 'w' (and 'f') programs. These entries in /usr/adm/utmp are made by 'xdm' when a user logs in from an xterminal; they do not represent an actual shell. Each entry in this above file has a field called 'ut_line' which normally is the tty line used by that particular user. Now, the 'w' program uses the ut_line field in order to get the idle-time (uses it to make a string e.g. "/dev/ttyp6", then does a stat() call on it); however, xdm has put the name of the xterminal in this field (e.g. "aji" for the "starkey" entry above). Thus, 'w' looks for a file "/dev/aji...." now, I don't have source, so I can only guess that 'w' does NOT check the return-value of this stat() call, but proceeds as if it had worked. It then uses one of the fields in the stat-struct to get the idle-time. In the cases where the call actually failed, the field that it uses has a value of 0. BUT! this value represents the number of seconds that have elapsed since 01 Jan 1970, since this /dev entry was last used ... thus the 8882 days ago. You will see that this field increases daily. Problem is still present is OSF 2.0 -SRK -- Dept of Computer Science Internet: stuart@cs.jcu.edu.au James Cook University Townsville Tel: +61 77 814992 Qld 4811 Australia FAX: +61 77 814029