Public bug reported:

Binary package hint: redhat-cluster-suite

I originally discovered this bug in Ubuntu 8.04 LTS. I've also submitted
this as:

https://bugzilla.redhat.com/show_bug.cgi?id=460060


Description of problem:
clustat(8) offers no way of obtaining untruncated columns when its stdout is
not a TTY. As a result, it is impossible to obtain untruncated service names
when calling clustat(8) from a script or any situation where its output is
being parsed programmatically.

Version-Release number of selected component (if applicable):
Latest available in RHEL5. The cluster3 master branch at:

http://sources.redhat.com/cluster/wiki/

also exhibits this behavior.

How reproducible:
Always.


>From rgmanager/src/utils/clustat.c:

  34 int dimx = 80, dimy = 24, stdout_is_tty = 0;
[...]
1103         if (isatty(STDOUT_FILENO)) {
1104                 stdout_is_tty = 1;
1105                 setupterm((char *) 0, STDOUT_FILENO, (int *) 0);
1106                 dimx = tigetnum("cols");
1107                 dimy = tigetnum("lines");
1108         }

dimx is initialized to 80 columns. No code other than the above modifies dimx.
Therefore, when the environment variable COLUMNS is set, its value is never
honored when stdout is not going to a TTY. This causes the Service Name column
to be truncated as though the output was being emitted on an 80-column
terminal:

 Service Name                   Owner (Last)                   State         
 ------- ----                   ----- ------                   -----         
 service:cl01-svc01.roch.ny.exa (cl01-host01)                  disabled      
 service:cl01-svc02.roch.ny.exa (cl01-host02)                  disabled      
 service:cl01-svc03.roch.ny.exa cl01-host03                    started       
 service:cl01-svc04.roch.ny.exa cl01-host04                    started       

Ideally, columnar data would *never* be truncated when output is not going to a
TTY, so programmatic callers do not have to worry about setting COLUMNS.

** Affects: redhat-cluster-suite (Ubuntu)
     Importance: Undecided
         Status: New

-- 
clustat(8) truncates columnar output when stdout is not a TTY
https://bugs.launchpad.net/bugs/261274
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to