[procps] Re: top buglets + misc

  • From: Jim Warner <james.warner@xxxxxxxxxxx>
  • To: procps@xxxxxxxxxxxxx
  • Date: Fri, 17 Feb 2012 08:10:01 -0600

On Feb 17, 2012, at 3:43 AM, Sami Kerola wrote:

> I don't understand how that script would work. People who want to run
> top they want to type top and see results. That meand the script has
> to have name top, and exist in path before top binary. Rather than
> relying on availability of script (which we do not even deliver) and
> it being in correct position in PATH I would recommend putting
> following lines to profile.

Hi Sami,

I wasn't thinking of a single script but of multiple scripts tailored to 
specific hosts.  Maybe named HOSTNAME-top or something like it.  Then there 
would be no PATH issues and one could be certain which top was being invoked.

Perhaps such an approach could be combined with Craig's suggestion here.  Then 
one would know which top was being invoked and be able to tell at a glance 
which top was being observed.
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340751


> if [ 2 -lt $(top -V | awk '$2 ~ /^version$/ {split($3, VER, ".");
> print VER[1]}') ]; then
>        NEWTOPRC_SUBDIR=.newtop_rcdir
>        if [ ! -d  $HOME/$NEWTOPRC_SUBDIR ]; then
>                mkdir -p $HOME/$NEWTOPRC_SUBDIR
>        fi
>        alias top="HOME=$HOME/$NEWTOPRC_SUBDIR top"
> fi
> 
> Advising that feels wrong. Is it really hard requirement to have toprc
> path clash? Attachment related.

There would be no clash if there were multiple scripts.  Besides, this patch 
deals with versions of top but not with various systems where top may be run.

And incidentally, there has been no change the SYS_RCFILESPEC file contents 
since its inception and so never a need to "unclash" it.


> p.s. If not changing rc file name is requirement could at least that
> scriptlet be part of documentation? I am nearly sure I'm not the only
> sysadmin looking after heterogeneous non-synchronized systems where
> there are and isn't NFS shared home directory on nearly random set of
> servers. This use case might be significant as the top is system admin
> utility.

I'm not a sysadmin, Sami, nor am I very versed in networking.  My experience 
consists solely of ssh'ing around my home network.  But I would like to know 
how your original TOPRC approach was to be handled in the environment you cite 
above.

At this point, I don't know if you are trying to solve a perceived problem for 
an ordinary user (should they be running top anyway?) or a sysadmin.  But to 
suggest that my simple scriptlet become part of the distribution seems a little 
silly.

Regards,
Jim


Other related posts: