Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 138285 - zz-disk_space broken for mountpoints longer than ~20 chars
Summary: zz-disk_space broken for mountpoints longer than ~20 chars
Alias: None
Product: Fedora
Classification: Fedora
Component: logwatch
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jiri Ryska
QA Contact:
: 140687 141579 142233 143985 155286 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2004-11-07 14:41 UTC by Doncho Gunchev
Modified: 2007-11-30 22:10 UTC (History)
9 users (show)

Fixed In Version: logwatch-5.2.2-1.FC3.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-04-26 13:42:35 UTC

Attachments (Terms of Use)

Description Doncho Gunchev 2004-11-07 14:41:56 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20041020

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/hda1             251M   20M  219M   9% /boot
... cut ....
because df outputs 2 lines for long mountpoints:
--- df -h -----------------------------------------------------
[pts/9 mr700@fedora:~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
                     1008M  513M  445M  54% /
/dev/hda1             251M   20M  219M   9% /boot
... cut ....

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

How reproducible:

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 14:30:02 UTC
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 Gunchev 2004-11-08 16:12:09 UTC
True :) I'm not so good with grep :)
Now I see:
                      1.2G  740M  397M  66% /
/dev/md0              251M   42M  197M  18% /boot
                      1.2G   34M  1.1G   3% /tmp

Comment 3 Jiri Ryska 2004-11-09 13:43:36 UTC

Comment 4 Jiri Ryska 2004-11-24 11:50:17 UTC
*** Bug 140687 has been marked as a duplicate of this bug. ***

Comment 5 Doncho Gunchev 2004-12-03 17:14:50 UTC
    I have to close this when an update is released, but it is still
not, right? Or...?

Comment 6 Jiri Ryska 2004-12-06 14:17:42 UTC
*** Bug 141579 has been marked as a duplicate of this bug. ***

Comment 7 Jiri Ryska 2004-12-08 12:16:05 UTC
*** Bug 142233 has been marked as a duplicate of this bug. ***

Comment 8 Jiri Ryska 2005-01-03 13:51:58 UTC
*** Bug 143985 has been marked as a duplicate of this bug. ***

Comment 9 Doncho Gunchev 2005-03-24 07:33:17 UTC
    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 15:02:38 UTC
fixed in FC-3, for RHEL it will be fixed in next quartely update

Comment 11 Doncho Gunchev 2005-04-16 11:51:18 UTC
In FC3 and FC4t2 it is fixed. Closing with 'ERRATA' resolution (hope I guessed
this right).

Comment 12 Jiri Ryska 2005-04-19 10:30:29 UTC
*** Bug 155286 has been marked as a duplicate of this bug. ***

Comment 13 Lamont Peterson 2005-04-19 16:16:26 UTC
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 Gunchev 2005-04-19 19:26:35 UTC
You are right... I've fixed it by hand on one of my systems (rpmverify fails).

Comment 15 Antonin Mares 2005-04-24 09:33:11 UTC
Applied logwatch-5.2.2-1.FC3 from updates and bug is still present.

Comment 16 Lamont Peterson 2005-04-24 21:48:50 UTC
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                     
Notice the difference in the "df" command?  That is why it is not quite 
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 <>. Also, 
here is the patch file:  
--- etc/log.d/scripts/services/zz-disk_space 2005-04-24 16:29:34.000000000  
+++ etc/log.d/scripts/services/zz-disk_space 2005-04-24 16:31:21.000000000  
@@ -17,8 +17,7 @@  
    echo "------------------ Disk Space --------------------"  
-   df -h | grep '^/dev/' | \  
-     sed 's/\([^[:space:]]\{20,\}\)\(.*\)/\1\n                    \2/'  
+   df -hP | grep '^/dev' | sed 's/\([^[:space:]]\{20,\}\)\(.*\)/\1\n                     
 elif [ "$PRINTING" = "y" ] ; then  

Comment 17 Petr Krištof 2005-04-25 11:56:24 UTC
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 13:59:06 UTC
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.