[libvirt] [PATCH] daemon: Prefix sysctl configuration file with numbers

Apparently, files in /usr/lib/sysctl.d are usually prefixed with numbers for easier ordering. Let's be consistent with this. I chose 60 for libvirtd so that it goes after 50-default.conf. https://bugzilla.redhat.com/show_bug.cgi?id=1084876 Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- Notes: Actually, %config(noreplace) for a file in /usr/lib/sysctl.d looks somewhat wrong to me and I think we should fix that too. After all the files are usually placed in /usr/lib because they are not supposed to be modified by administrators. They should be able to override the settings in /etc/. Any opinion about this? daemon/Makefile.am | 4 ++-- libvirt.spec.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index b95a79d..bceaeb2 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -341,10 +341,10 @@ if WITH_SYSCTL install-sysctl: $(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d $(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \ - $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf + $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf uninstall-sysctl: - rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf + rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || : else ! WITH_SYSCTL install-sysctl: diff --git a/libvirt.spec.in b/libvirt.spec.in index 4c11ab7..e08c9e7 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1609,7 +1609,7 @@ mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \ %endif %if 0%{?rhel} == 5 -rm -f $RPM_BUILD_ROOT%{_prefix}/lib/sysctl.d/libvirtd.conf +rm -f $RPM_BUILD_ROOT%{_prefix}/lib/sysctl.d/60-libvirtd.conf %endif %clean @@ -1897,7 +1897,7 @@ exit 0 %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf %config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf %if 0%{?fedora} || 0%{?rhel} >= 6 -%config(noreplace) %{_prefix}/lib/sysctl.d/libvirtd.conf +%config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf %endif %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd -- 2.3.5

On 15.04.2015 13:12, Jiri Denemark wrote:
Apparently, files in /usr/lib/sysctl.d are usually prefixed with numbers for easier ordering. Let's be consistent with this. I chose 60 for libvirtd so that it goes after 50-default.conf.
https://bugzilla.redhat.com/show_bug.cgi?id=1084876 Signed-off-by: Jiri Denemark <jdenemar@redhat.com> ---
Notes: Actually, %config(noreplace) for a file in /usr/lib/sysctl.d looks somewhat wrong to me and I think we should fix that too. After all the files are usually placed in /usr/lib because they are not supposed to be modified by administrators. They should be able to override the settings in /etc/. Any opinion about this?
daemon/Makefile.am | 4 ++-- libvirt.spec.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
ACK Michal

On 04/15/2015 05:12 AM, Jiri Denemark wrote:
Apparently, files in /usr/lib/sysctl.d are usually prefixed with numbers for easier ordering. Let's be consistent with this. I chose 60 for libvirtd so that it goes after 50-default.conf.
https://bugzilla.redhat.com/show_bug.cgi?id=1084876 Signed-off-by: Jiri Denemark <jdenemar@redhat.com> ---
Notes: Actually, %config(noreplace) for a file in /usr/lib/sysctl.d looks somewhat wrong to me and I think we should fix that too. After all the files are usually placed in /usr/lib because they are not supposed to be modified by administrators. They should be able to override the settings in /etc/. Any opinion about this?
I think the idea of allowing overrides from /etc makes sense - but do we actually parse up to two files, with the last parse winning? If not, that's more code to add first. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, Apr 16, 2015 at 06:45:44 -0600, Eric Blake wrote:
On 04/15/2015 05:12 AM, Jiri Denemark wrote:
Apparently, files in /usr/lib/sysctl.d are usually prefixed with numbers for easier ordering. Let's be consistent with this. I chose 60 for libvirtd so that it goes after 50-default.conf.
https://bugzilla.redhat.com/show_bug.cgi?id=1084876 Signed-off-by: Jiri Denemark <jdenemar@redhat.com> ---
Notes: Actually, %config(noreplace) for a file in /usr/lib/sysctl.d looks somewhat wrong to me and I think we should fix that too. After all the files are usually placed in /usr/lib because they are not supposed to be modified by administrators. They should be able to override the settings in /etc/. Any opinion about this?
I think the idea of allowing overrides from /etc makes sense - but do we actually parse up to two files, with the last parse winning? If not, that's more code to add first.
I haven't checked, since "we" is the service running sysctl on boot rather than libvirt. I was hoping someone would just know how it works. I'll try to investigate. Anyway, I pushed the patch without touching the config(noreplace) part. Jirka
participants (3)
-
Eric Blake
-
Jiri Denemark
-
Michal Privoznik