Bug 357591 - rwhod reports all idle times as zero
rwhod reports all idle times as zero
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: rwho (Show other bugs)
7
All Linux
low Severity low
: ---
: ---
Assigned To: Jiri Moskovcak
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-30 00:31 EDT by Ian Donaldson
Modified: 2015-02-01 17:47 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-07 06:50:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ian Donaldson 2007-10-30 00:31:24 EDT
Description of problem:

rwhod as distributed in FC7 sends out data with we_idle = 0 for all ptys
(i386, x86_64 confirmed; confirmed with wireshark)




Version-Release number of selected component (if applicable):

rwho-0.17-26

How reproducible:

100% reproducable

Steps to Reproduce:
1. start rwhod: /etc/init.d/rwhod start
2. login to kde; start a bunch of xterms or konsoles,
   wait a few mins
3. run 'rwho'.  observe all tty idle times not displayed for any (ie: 0)
  
Actual results:
zero idle times for all ttys

Expected results:
correct idle times

Additional info:

Fetched rwho-0.17-26.src.rpm; built it using rpmbuild -bc and ran
that rwhod; worked fine.  idle times correct!  

NB: size of binary built isn't same as released binary.

$ cat /etc/issue
Fedora release 7 (Moonshine)
Kernel \r on an \m

$ uname -a
Linux hostname 2.6.22.9-91.fc7 #1 SMP Thu Sep 27 23:10:59 EDT 2007 i686 i686
i386 GNU/Linux

$ rpm -q rwho
rwho-0.17-26

$ pwd
/usr/src/redhat/BUILD/netkit-rwho-0.17/rwhod
$ size /usr/sbin/rwhod rwhod
   text    data     bss     dec     hex filename
  10534     792      60   11386    2c7a /usr/sbin/rwhod
  10432     792      64   11288    2c18 rwhod

palace$ w | head
 15:24:23 up 12 days,  1:04, 26 users,  load average: 0.46, 0.41, 0.30
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
iand     pts/0    :0.0             18Oct07  3days  1.63s  1.63s  ...
iand     pts/1    :0.0             18Oct07  6days  1.49s  1.49s  ...

$ rwho | grep palace |grep 'pts/[01] '
iand     palace:pts/0    Oct 18 13:22
iand     palace:pts/1    Oct 18 13:22

This suggests a problem with the release building process; perhaps
the used include file protocols/rwhod.h was different during release?
(include search path issue?)
Comment 1 Jiri Moskovcak 2007-10-30 05:31:52 EDT
The package from official repository works fine for me - it shows the idle times
correctly. Could you please try to install the package via "yum install rwho".

Thank you

jirka
Comment 2 Ian Donaldson 2007-10-30 08:07:11 EDT
The systems involved were a mixture of fresh install and upgrades from FC4,
with 'yum update' applied using a cached update area from about 2 weeks ago.

All have selinux enabled in enforcing but targeted mode.


This would appear to related.  A strace of rwhod is showing this:

   ...
restart_syscall(<... resuming interrupted call ...>) = 0
time(NULL)                              = 1193745154
stat64("/var/run/utmp", {st_mode=S_IFREG|0664, st_size=17664, ...}) = 0
chdir("/dev/")                          = 0
stat64("pts/0", 0xbfd13050)             = -1 EACCES (Permission denied)
stat64("pts/1", 0xbfd13050)             = -1 EACCES (Permission denied)
stat64("pts/3", 0xbfd13050)             = -1 EACCES (Permission denied)
stat64("pts/4", 0xbfd13050)             = -1 EACCES (Permission denied)
stat64("pts/5", 0xbfd13050)             = -1 EACCES (Permission denied)
stat64("pts/6", 0xbfd13050)             = -1 EACCES (Permission denied)
stat64("pts/7", 0xbfd13050)             = -1 EACCES (Permission denied)
stat64("pts/8", 0xbfd13050)             = -1 EACCES (Permission denied)
stat64("pts/9", 0xbfd13050)             = -1 EACCES (Permission denied)
stat64("pts/10", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/11", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/12", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/13", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/14", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/15", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/16", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/17", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/18", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/19", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/20", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/21", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/22", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/23", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/24", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/25", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/26", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/27", 0xbfd13050)            = -1 EACCES (Permission denied)
stat64("pts/28", 0xbfd13050)            = -1 EACCES (Permission denied)
open("/proc/loadavg", O_RDONLY)         = 4
fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7f4a000
   ...


palace$ ls -lZ /usr/sbin/rwhod
-rwxr-xr-x  root root system_u:object_r:rwho_exec_t    /usr/sbin/rwhod

palace$ ls -l /usr/sbin/rwhod
-rwxr-xr-x 1 root root 13012 Aug 15  2006 /usr/sbin/rwhod

palace$ md5sum /usr/sbin/rwhod
1bc8b22dfff89e6f44248f219029ed5a  /usr/sbin/rwhod

palace# rpm -q --verify rwho
palace# rpm -q rwho
rwho-0.17-26


palace$ ps -efZ |grep rwho
user_u:system_r:rwho_t          root      8969     1  0 22:49 ?        00:00:00
rwhod
user_u:system_r:rwho_t          root      8970  8969  0 22:49 ?        00:00:00
rwhod

palace$ ls -lZd /dev /dev/pts /dev/pts/0
drwxr-xr-x  root root system_u:object_r:device_t       /dev
drwxr-xr-x  root root system_u:object_r:devpts_t       /dev/pts
crw--w----  iand tty  user_u:object_r:devpts_t         /dev/pts/0


However copying the version of rwhod I built from SRPM into
the same place and setting same selinux permissions using

	chcon --reference=rwhod.orig rwhod

works fine.

Below is an strace of that version...

stat64("pts/0", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
stat64("pts/1", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
stat64("pts/3", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 3), ...}) = 0
stat64("pts/4", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 4), ...}) = 0
stat64("pts/5", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 5), ...}) = 0
stat64("pts/6", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 6), ...}) = 0
stat64("pts/7", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 7), ...}) = 0
stat64("pts/8", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 8), ...}) = 0
stat64("pts/9", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 9), ...}) = 0
stat64("pts/10", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 10), ...}) = 0
stat64("pts/11", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 11), ...}) = 0
stat64("pts/12", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 12), ...}) = 0
stat64("pts/13", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 13), ...}) = 0
stat64("pts/14", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 14), ...}) = 0
stat64("pts/15", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 15), ...}) = 0
stat64("pts/16", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 16), ...}) = 0
stat64("pts/17", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 17), ...}) = 0
stat64("pts/18", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 18), ...}) = 0
stat64("pts/19", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 19), ...}) = 0
stat64("pts/20", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 20), ...}) = 0
stat64("pts/21", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 21), ...}) = 0
stat64("pts/22", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 22), ...}) = 0
stat64("pts/23", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 23), ...}) = 0
stat64("pts/24", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 24), ...}) = 0
stat64("pts/25", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 25), ...}) = 0
stat64("pts/26", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 26), ...}) = 0
stat64("pts/27", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 27), ...}) = 0
stat64("pts/28", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 28), ...}) = 0



Note You need to log in before you can comment on or make changes to this bug.