Bug 713218

Summary: Linking /etc/mtab to /proc/self/mounts breaks collectd
Product: [openSUSE] openSUSE 11.4 Reporter: Rafal Kwasny <mag>
Component: BasesystemAssignee: Roman Neuhauser <rneuhauser>
Status: VERIFIED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: aduffeck, aspiers, pth, puzel, stefan.bruens
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Rafal Kwasny 2011-08-19 17:03:58 UTC
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.94 Safari/535.1

While running SuSEstudio build appliance I encountered an issue with collectd:

Aug 19 18:51:23 BlackBox collectd[15378]: uc_update: Value too old: name = WebYaST/df/df-root; value time = 1313772683; last cache update = 1313772683;
Aug 19 18:51:23 BlackBox collectd[15378]: Filter subsystem: Built-in target `write': Dispatching value to all write plugins failed with status -1.
Aug 19 18:51:33 BlackBox collectd[15378]: uc_update: Value too old: name = WebYaST/df/df-root; value time = 1313772693; last cache update = 1313772693;

It seems linking /etc/mtab to /proc/self/mounts is not a great idea because then rootfs is shown two times in `df` output:

# df -h
Filesystem            Size  Used Avail Use% Mounted on
rootfs                230G  1,4G  217G   1% /
devtmpfs              432M   96K  432M   1% /dev
tmpfs                 435M  4,0K  435M   1% /dev/shm
/dev/sda1             230G  1,4G  217G   1% /

and this results in duplicate values in collectd



Reproducible: Always

Steps to Reproduce:
1. Run a system build via kiwi/susestudio with webyast
2. see /var/log/messages
Comment 1 Andre Duffeck 2011-08-30 10:29:09 UTC
Balazs, can you look into that?
Comment 2 Adam Spiers 2012-02-23 11:22:05 UTC
I see the mtab symlink with two fresh builds of openSUSE 12.1 from DVD onto physical machines so it's not exclusive to susestudio.

lrwxrwxrwx 1 root root 17 Mar 18  2011 /etc/mtab -> /proc/self/mounts

Presumably there is a good reason for doing that, in which case the problem lies with collectd's df plugin, which is enabled by default with no configuration.  I guess most people do not see it because it is (only?) required by webyast:

# rpm -q --whatrequires collectd
webyast-status-ws-0.2.13-2.1.2.noarch
Comment 3 Adam Spiers 2012-02-23 11:23:16 UTC
By the way an easy workaround is to comment out the 'LoadPlugin df' line of /etc/collectd.conf.  I'm not sure if this breaks anything in WebYaST though.
Comment 4 Adam Spiers 2012-02-23 11:28:37 UTC
Sorry for the bug spam, this will be my last comment (for now ;-) 

(In reply to comment #2)
> I see the mtab symlink with two fresh builds of openSUSE 12.1 from DVD onto
> physical machines so it's not exclusive to susestudio.
> 
> lrwxrwxrwx 1 root root 17 Mar 18  2011 /etc/mtab -> /proc/self/mounts
> 
> Presumably there is a good reason for doing that

I found the good reason:

http://lists.opensuse.org/opensuse-factory/2011-01/msg00130.html

Adding Petr to Cc in case he has any ideas ...
Comment 5 Petr Uzel 2012-02-23 12:16:52 UTC
(In reply to comment #4)
> I found the good reason:
> 
> http://lists.opensuse.org/opensuse-factory/2011-01/msg00130.html
> 
> Adding Petr to Cc in case he has any ideas ...

Well, my only idea is to fix the 'df' utility not to print the rootfs information twice. Adding coreutils maintainer to CC.
Comment 6 Philipp Thomas 2012-02-23 12:31:38 UTC
How is df supposed to be able to distinguish which of the multiple entries to suppress?
Comment 7 Philipp Thomas 2012-02-23 12:43:51 UTC
/proc/mounts lists all mounts as they occurred, i.e. / from initram and then the actual device. If you loop mounted dev you would have two /dev entries. It is IMO up to the user of df's output to filter the information.
Comment 8 Roman Neuhauser 2012-05-22 12:48:04 UTC
this is an issue in OpenSUSE, and it's been fixed in revision 4 of the collectd package in Factory:

https://build.opensuse.org/package/rdiff?linkrev=base&package=collectd&project=openSUSE%3AFactory&rev=4
Comment 9 Adam Spiers 2012-09-25 11:20:14 UTC
This seems to be a duplicate of bug 709543, however this one has more useful information so the other one should probably be resolved as a duplicate of this one.

BTW commenting out loading of the df plugin and restarting collectd no longer works for me as a workaround :-(
Comment 10 Stefan BrĂ¼ns 2012-09-25 11:42:44 UTC
Both bug 709543 and the fix mentioned in #c8 are done by me, so yes, close as duplicate.
Comment 11 Adam Spiers 2012-10-08 15:10:40 UTC
*** Bug 709543 has been marked as a duplicate of this bug. ***
Comment 12 Adam Spiers 2013-01-11 17:13:13 UTC
(In reply to comment #8)
> this is an issue in OpenSUSE, and it's been fixed in revision 4 of the collectd
> package in Factory:
> 
> https://build.opensuse.org/package/rdiff?linkrev=base&package=collectd&project=openSUSE%3AFactory&rev=4

The .changes file doesn't reference this bug number :-/

Also, can this be backported to 12.2?