Bug 770729

Summary: configuration in /etc/toprc is not reflecting.
Product: Red Hat Enterprise Linux 6 Reporter: Pratik Pravin Bandarkar <pbandark>
Component: tog-pegasusAssignee: Vitezslav Crhonek <vcrhonek>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-30 10:16:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Pratik Pravin Bandarkar 2011-12-28 16:47:55 UTC
Description of problem:

The configuration in /etc/toprc (global configuration file)file is not reflecting the chages in output of top command. It is working for individual user.  i.e. if we modify top as per our requirement and the press "shit+w" then it wll save the current configuration in respective users home directory.  As per man page of top the entries in /etc/toprc are as:
-------->o--------->o---------
 The  system  configuration  file  is not created by top.  Rather, you create this
       file manually and place it in the /etc directory.  Its name must be  ’toprc’  and
       must have no leading ’.’ (period).  It must have only two lines.

       Here is an example of the contents of /etc/toprc:
          s         # line 1: ’secure’ mode switch
          5.0       # line 2: ’delay’  interval in seconds
-----------o<----------o<------

But, in top command still getting delay of 3 seconds.  I checked strace output  and  it seems that "top" command is checking the "/etc/toprc" file:
------
[...]
 open("/etc/toprc", O_RDONLY)            = 3
[...]
-----

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


How reproducible:
yes
Steps to Reproduce:
1. Create /etc/toprc file
2. mention entries as bellow:(as per man page of top)
---
s
5.0
---
3. check ouput of top command.  
Actual results:
in top command output interval is 3 sec.

Expected results:
Top command should consider /etc/toprc file.

Additional info:

I observed this issue with RHEL5.6 as well.

Comment 2 Pratik Pravin Bandarkar 2011-12-30 10:16:25 UTC
Internal comment:
-----
After discussing the issue with senior engineer I found that, it is not a bug. If we create /etc/toprc file then we have to check with normal user. It works for normal user. But it is not the case with root user. for root user the chages did not get applied. which is default behavior. As this is not a bug, its default behavior I am closing this bz.