Bug 138285 - zz-disk_space broken for mountpoints longer than ~20 chars
zz-disk_space broken for mountpoints longer than ~20 chars
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: logwatch (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jiri Ryska
:
: 140687 141579 142233 143985 155286 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-07 09:41 EST by Doncho N. Gunchev
Modified: 2007-11-30 17:10 EST (History)
9 users (show)

See Also:
Fixed In Version: logwatch-5.2.2-1.FC3.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-04-26 09:42:35 EDT
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 Doncho N. Gunchev 2004-11-07 09:41:56 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20041020
Firefox/0.10.1

Description of problem:
zz-disk_space uses "df -h | grep '^/dev/'", which for me shows:
--- df -h | grep '^/dev/' -------------------------------------
[pts/9 mr700@fedora:~]$ df -h | grep '^/dev/'
/dev/mapper/VGmr700-LVroot
/dev/hda1             251M   20M  219M   9% /boot
/dev/mapper/VGmr700-LVhome
... cut ....
---------------------------------------------------------------
because df outputs 2 lines for long mountpoints:
--- df -h -----------------------------------------------------
[pts/9 mr700@fedora:~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VGmr700-LVroot
                     1008M  513M  445M  54% /
/dev/hda1             251M   20M  219M   9% /boot
... cut ....
---------------------------------------------------------------

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

How reproducible:
Always

Steps to Reproduce:
1. mount something under /mnt/some/longer/mountpoint
2. wait for logwatch's email

Actual Results:  All partitions mounted on mountpoint wider than ~20
chars have only names in logwatch's report.

Additional info:
    The problem is that 'df' splits the report on two lines when the
mountpoint is too long. I think this can be fixed quite easy with 'df
-hP'. The nice formating goes away btw, but it works.
Comment 1 Jiri Ryska 2004-11-08 09:30:02 EST
df -hP should work but if you want to have a nice formatting, you
should try this:
df -hP | grep '^/dev' | \
sed 's/\([^[:space:]]\{20,\}\)\(.*\)/\1\n                    \2/'
Comment 2 Doncho N. Gunchev 2004-11-08 11:12:09 EST
True :) I'm not so good with grep :)
Now I see:
...
/dev/mapper/VGshadow-LVroot
                      1.2G  740M  397M  66% /
/dev/md0              251M   42M  197M  18% /boot
/dev/mapper/VGshadow-LVtmp
                      1.2G   34M  1.1G   3% /tmp
...
Thanks!
Comment 3 Jiri Ryska 2004-11-09 08:43:36 EST
Applied
Comment 4 Jiri Ryska 2004-11-24 06:50:17 EST
*** Bug 140687 has been marked as a duplicate of this bug. ***
Comment 5 Doncho N. Gunchev 2004-12-03 12:14:50 EST
    I have to close this when an update is released, but it is still
not, right? Or...?
Comment 6 Jiri Ryska 2004-12-06 09:17:42 EST
*** Bug 141579 has been marked as a duplicate of this bug. ***
Comment 7 Jiri Ryska 2004-12-08 07:16:05 EST
*** Bug 142233 has been marked as a duplicate of this bug. ***
Comment 8 Jiri Ryska 2005-01-03 08:51:58 EST
*** Bug 143985 has been marked as a duplicate of this bug. ***
Comment 9 Doncho N. Gunchev 2005-03-24 02:33:17 EST
    I still see the same bug with FC3 and in logwatch-5.2.2-1.src.rpm (from RHEL
4) it is still present, so I reopen it.
Comment 10 Jiri Ryska 2005-04-12 11:02:38 EDT
fixed in FC-3, for RHEL it will be fixed in next quartely update
Comment 11 Doncho N. Gunchev 2005-04-16 07:51:18 EDT
In FC3 and FC4t2 it is fixed. Closing with 'ERRATA' resolution (hope I guessed
this right).
Comment 12 Jiri Ryska 2005-04-19 06:30:29 EDT
*** Bug 155286 has been marked as a duplicate of this bug. ***
Comment 13 Lamont Peterson 2005-04-19 12:16:26 EDT
I have all available errata to FC3 applied.  This bug is still present on     
there (I have not looked to see if it is present on RHEL4 or not.    
    
The change has not been applied to /etc/log.d/scripts/services/zz-disk_space.     
Here is a patch file for FC3.  I made a patch file, but I have no way to   
attach it to this bug (I have emailed the patch to Jiri Ryska).  The patch 
applies the fix listed above. 
   
It is *not* fixed in logwatch-5.2.2-1 (at least on FC3).   
   
Please, reopen this bug until it really is fixed.  Thank you.   
Comment 14 Doncho N. Gunchev 2005-04-19 15:26:35 EDT
You are right... I've fixed it by hand on one of my systems (rpmverify fails).
Reopening.
Comment 15 Antonin Mares 2005-04-24 05:33:11 EDT
Applied logwatch-5.2.2-1.FC3 from updates and bug is still present.
Comment 16 Lamont Peterson 2005-04-24 17:48:50 EDT
After applying the errata released last week (5.2.2-1.FC3), the form of this  
bug modified slightly.  
  
It would seem that the patch file was not applied.  As it was just a one line  
change, I can understand the use of copy-and-paste for this.  
  
Unfortunately, whomever it was that performed the copy and paste only did part  
of the line, not the whole line.  Here is the line from 5.2.2-1.FC3 (it's 2  
lines instead of one as it was in my patch file):  
  
   df -h | grep '^/dev/' | \  
      sed 's/\([^[:space:]]\{20,\}\)\(.*\)/\1\n                    \2/'  
  
Here is what the patch file would have done:  
  
-   df -h | grep '^/dev/'  
+   df -hP | grep '^/dev' | sed 's/\([^[:space:]]\{20,\}\)\(.*\)/\1\n                     
\2/'  
  
Notice the difference in the "df" command?  That is why it is not quite 
working. 
  
Please, apply this patch file instead.  As I can not seem to attach a file to  
this bug, I will email the patch file to Jiri Ryska <jryska@redhat.com>. Also, 
here is the patch file:  
  
--- etc/log.d/scripts/services/zz-disk_space 2005-04-24 16:29:34.000000000  
-0600  
+++ etc/log.d/scripts/services/zz-disk_space 2005-04-24 16:31:21.000000000  
-0600  
@@ -17,8 +17,7 @@  
    echo  
    echo "------------------ Disk Space --------------------"  
    echo  
-   df -h | grep '^/dev/' | \  
-     sed 's/\([^[:space:]]\{20,\}\)\(.*\)/\1\n                    \2/'  
+   df -hP | grep '^/dev' | sed 's/\([^[:space:]]\{20,\}\)\(.*\)/\1\n                     
\2/'  
    echo  
 elif [ "$PRINTING" = "y" ] ; then  
    echo  
Comment 17 Petr Krištof 2005-04-25 07:56:24 EDT
I can testify the package logwatch-5.2.2-1.FC3 is not fixed and bug is remaining.
Comment 18 Jiri Ryska 2005-04-25 09:59:06 EDT
Oops, I wrote patch with df -h and not with df -hP... fixing

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