Bug 887017 - sub-configs in '/etc/sysctl.d' not being loaded as expected
Summary: sub-configs in '/etc/sysctl.d' not being loaded as expected
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 18
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Eric Blake
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 896149 902552 (view as bug list)
Depends On:
Blocks: 892693
TreeView+ depends on / blocked
 
Reported: 2012-12-13 20:28 UTC by Nicholas Schuetz
Modified: 2013-03-04 17:16 UTC (History)
25 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 892693 (view as bug list)
Environment:
Last Closed: 2013-03-04 17:16:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Nicholas Schuetz 2012-12-13 20:28:37 UTC
The sub-config files located in the folder '/etc/sysctl.d' are not being loaded on bootup.  See below for example.


<after bootup>

[root@desktop ~]# cat /etc/sysctl.d/libvirtd |grep -v ^#
fs.aio-max-nr = 1048576

[root@desktop ~]# cat /etc/sysctl.d/postgresql 
kernel.shmmax=446668800

[root@desktop ~]# sysctl -a |grep fs.aio-max-nr
fs.aio-max-nr = 65536

[root@desktop ~]# sysctl -a |grep kernel.shmmax
kernel.shmmax = 33554432

As you can see, the values are not proper after the system boots.  If i manually set the values to the desired setting via the sysctl utility from the CLI, then all is well.

Version is Fedora 18 Beta with current patch level as of today (12/13/2012). see below for actually version number of initscripts....

[root@desktop ~]# rpm -qf /etc/sysctl.conf 
initscripts-9.42.1-1.fc18.x86_64

Comment 1 Bill Nottingham 2012-12-13 20:49:24 UTC
See 'man sysctl.d' - files should end with '.conf'.

Comment 2 Nicholas Schuetz 2012-12-14 01:04:41 UTC
Ah, yes... I guess i should file this under the *libvirt-daemon* package then.  The libvirtd file under the /etc/sysctl.d directory (in the libvirt-daemon pacakge) does not have the .conf extension and it's settings are not being applied.

# rpm -qf /etc/sysctl.d/libvirtd
libvirt-daemon-0.10.2.2-1.fc18.x86_64

# cat /etc/sysctl.d/libvirtd |grep -v ^#
fs.aio-max-nr = 1048576

#

Comment 3 Eric Blake 2012-12-16 05:21:58 UTC
Reading that man page, it sounds like libvirt should be installing into /usr/lib/sysctl.d/libvirt.conf, not /etc/sysctl.d/ - so it is more than just a wrong suffix, but a wrong location.

Comment 4 Bill Nottingham 2012-12-17 19:26:29 UTC
/etc will work, but /usr/lib/sysctl.d is preferred for system-distributed configurations.

Comment 5 Nicholas Schuetz 2012-12-18 18:55:37 UTC
I guess that just leaves the matter of adding the proper '.conf' suffix to the file then.

Comment 6 Eric Blake 2013-01-04 21:05:36 UTC
In the spec file, how does one guarantee that the file will be installed into /usr/lib/sysctl.d, even when %{_libdir} is /usr/lib64?

Comment 7 Kay Sievers 2013-01-04 21:14:48 UTC
/usr/lib/<pkgname>/ has nothing to do with %{_libdir} or multi-lib.
It is always:
  %{_prefix}/lib/<pkgname>
and treated as the "application private directory" which is the same
for all architectures and systems.

%{_libdir} is for shared libraries and almost nothing else.

Comment 8 Eric Blake 2013-01-04 22:37:27 UTC
Upstream patch proposed:
https://www.redhat.com/archives/libvir-list/2013-January/msg00223.html

Comment 9 Eric Blake 2013-01-07 16:10:39 UTC
This commit addresses the bug, and the three commits beforehand are probably also worth pulling into F18.  I'll go ahead and do the backport work for the v0.10.2-maint branch.

commit a1fd56cb3057c45cffbf5d41eaf70a26d2116b20
Author: Eric Blake <eblake>
Date:   Fri Jan 4 14:21:59 2013 -0700

    build: install libvirt sysctl file correctly
    
    https://bugzilla.redhat.com/show_bug.cgi?id=887017 reports that
    even though libvirt attempts to set fs.aio-max-nr via sysctl,
    the file was installed with the wrong name and gets ignored by
    sysctl.  Furthermore, 'man systcl.d' recommends that packages
    install into hard-coded /usr/lib/sysctl.d (even when libdir is
    /usr/lib64), so that sysadmins can use /etc/sysctl.d for overrides.
    
    * daemon/Makefile.am (install-sysctl, uninstall-sysctl): Use
    correct location.
    * libvirt.spec.in (network_files): Reflect this.

Comment 10 Eric Blake 2013-01-16 19:43:42 UTC
*** Bug 896149 has been marked as a duplicate of this bug. ***

Comment 11 Eric Blake 2013-01-22 13:29:11 UTC
*** Bug 902552 has been marked as a duplicate of this bug. ***

Comment 12 Fedora Update System 2013-01-28 20:46:10 UTC
libvirt-0.10.2.3-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/libvirt-0.10.2.3-1.fc18

Comment 13 Michal Ambroz 2013-01-31 11:15:40 UTC
I can confirm issue is fixed in libvirt-daemon-0.10.2.3-1.fc18.
File is /usr/lib/sysctl.d/libvirtd.conf and gets successfully processed by systemd-sysctl.service

# systemctl restart systemd-sysctl.service 
# sysctl -a|grep fs.aio
fs.aio-max-nr = 1048576
fs.aio-nr = 0

Comment 14 Fedora Update System 2013-02-05 16:53:10 UTC
libvirt-0.10.2.3-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.


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