[libvirt] [PATCH 0/4] installed service file cleanups

This started based on a bug report from Jim Fehlig[1], but turned into a fix for another issue[2] in a patch by Guido Günther as well as an open bugzilla[3] fix. [1]https://www.redhat.com/archives/libvir-list/2013-January/msg00198.html [2]https://www.redhat.com/archives/libvir-list/2013-January/msg00130.html [3]https://bugzilla.redhat.com/show_bug.cgi?id=887017 I've run the series through './autobuild.sh', which includes 'make dist' and 'make rpm', so I'm reasonably confident that I didn't botch things. But as always, a careful review is appreciated :) Eric Blake (4): build: use common .in replacement mechanism build: properly substitute virtlockd.socket build: .service files don't need to be executable build: install libvirt sysctl file correctly daemon/Makefile.am | 49 +++++++++++++++++++++-------------------- libvirt.spec.in | 4 ++-- src/Makefile.am | 32 +++++++++++---------------- src/locking/virtlockd.init.in | 14 ++++++------ src/locking/virtlockd.socket.in | 2 +- tools/Makefile.am | 49 ++++++++++++++++++++--------------------- tools/virt-pki-validate.in | 2 +- tools/virt-sanlock-cleanup.in | 6 ++--- tools/virt-xml-validate.in | 2 +- 9 files changed, 77 insertions(+), 83 deletions(-) -- 1.8.0.2

We had several different styles of .in conversion in our Makefiles: ALLCAPS, @ALLCAPS@, @lower@, ::lower:: Canonicalize on one form, to make it easier to copy and paste between .in files. Also, we were using some non-portable sed constructs: \@ is an undefined escape sequence (it happens to be @ itself in GNU sed, but POSIX allows it to mean something else), as well as risky behavior (failure to consistently quote things means a space in $(sysconfdir) could throw things off; also, Autoconf recommends using | rather than , or ! in the s||| operator, because | has to be quoted in shell and is therefore less likely to appear in file names than , or !). Fix all of these uses to follow the same syntax. * daemon/libvirtd.8.in: Switch to @var@. * tools/virt-xml-validate.in: Likewise. * tools/virt-pki-validate.in: Likewise. * src/locking/virtlockd.init.in: Likewise. * daemon/Makefile.am: Prefer | over ! in sed. (libvirtd.8): Prefer consistent substitution. (libvirtd.init, libvirtd.service): Avoid non-portable sed. * tools/Makefile.am (libvirt-guests.sh, libvirt-guests.init) (libvirt-guests.service): Likewise. (virt-xml-validate, virt-pki-validate, virt-sanlock-cleanup): Prefer consistent capitalization. * src/Makefile.am (virtlockd.init, virtlockd.service) (virtlockd.socket): Prefer consistent substitution. --- daemon/Makefile.am | 40 +++++++++++++++++----------------- src/Makefile.am | 38 ++++++++++++++++---------------- src/locking/virtlockd.init.in | 14 ++++++------ tools/Makefile.am | 50 +++++++++++++++++++++---------------------- tools/virt-pki-validate.in | 2 +- tools/virt-sanlock-cleanup.in | 6 +++--- tools/virt-xml-validate.in | 2 +- 7 files changed, 76 insertions(+), 76 deletions(-) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 18a4bca..60112ff 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -## Copyright (C) 2005-2012 Red Hat, Inc. +## Copyright (C) 2005-2013 Red Hat, Inc. ## See COPYING.LIB for the License of this software INCLUDES = \ @@ -84,8 +84,8 @@ CLEANFILES += test_libvirtd.aug libvirtd.8: $(srcdir)/libvirtd.8.in $(AM_V_GEN)sed \ - -e 's!SYSCONFDIR!$(sysconfdir)!g' \ - -e 's!LOCALSTATEDIR!$(localstatedir)!g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@ @@ -181,7 +181,7 @@ endif libvirtd.policy: libvirtd.policy.in $(top_builddir)/config.status $(AM_V_GEN) sed \ - -e 's![@]authaction[@]!$(policyauth)!g' \ + -e 's|[@]authaction[@]|$(policyauth)|g' \ < $< > $@-t && \ mv $@-t $@ BUILT_SOURCES += libvirtd.policy @@ -222,25 +222,25 @@ BUILT_SOURCES += $(LOGROTATE_CONFS) libvirtd.logrotate: libvirtd.logrotate.in $(AM_V_GEN)sed \ - -e 's![@]localstatedir[@]!$(localstatedir)!g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@ libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in $(AM_V_GEN)sed \ - -e 's![@]localstatedir[@]!$(localstatedir)!g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@ libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in $(AM_V_GEN)sed \ - -e 's![@]localstatedir[@]!$(localstatedir)!g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@ libvirtd.uml.logrotate: libvirtd.uml.logrotate.in $(AM_V_GEN)sed \ - -e 's![@]localstatedir[@]!$(localstatedir)!g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@ @@ -340,21 +340,21 @@ uninstall-init-systemd: endif # LIBVIRT_INIT_SCRIPT_SYSTEMD libvirtd.init: libvirtd.init.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e s!\@localstatedir\@!$(localstatedir)!g \ - -e s!\@sbindir\@!$(sbindir)!g \ - -e s!\@sysconfdir\@!$(sysconfdir)!g \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@ libvirtd.service: libvirtd.service.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e s!\@localstatedir\@!$(localstatedir)!g \ - -e s!\@sbindir\@!$(sbindir)!g \ - -e s!\@sysconfdir\@!$(sysconfdir)!g \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@ diff --git a/src/Makefile.am b/src/Makefile.am index 0cfc1ed..0cc02ed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -## Copyright (C) 2005-2012 Red Hat, Inc. +## Copyright (C) 2005-2013 Red Hat, Inc. ## See COPYING.LIB for the License of this software # No libraries with the exception of LIBXML should be listed @@ -1665,12 +1665,12 @@ uninstall-init:: endif virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e "s!::localstatedir::!$(localstatedir)!g" \ - -e "s!::sbindir::!$(sbindir)!g" \ - -e "s!::sysconfdir::!$(sysconfdir)!g" \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@ @@ -1706,21 +1706,21 @@ uninstall-systemd: endif virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e "s!::localstatedir::!$(localstatedir)!g" \ - -e "s!::sbindir::!$(sbindir)!g" \ - -e "s!::sysconfdir::!$(sysconfdir)!g" \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@ virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e "s!::localstatedir::!$(localstatedir)!g" \ - -e "s!::sbindir::!$(sbindir)!g" \ - -e "s!::sysconfdir::!$(sysconfdir)!g" \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@ diff --git a/src/locking/virtlockd.init.in b/src/locking/virtlockd.init.in index e55cbf9..1adea07 100644 --- a/src/locking/virtlockd.init.in +++ b/src/locking/virtlockd.init.in @@ -20,19 +20,19 @@ # on virtual machine disk images # # processname: virtlockd -# pidfile: ::localstatedir::/run/libvirt/virtlockd.pid +# pidfile: @localstatedir@/run/libvirt/virtlockd.pid # # Source function library. -. ::sysconfdir::/rc.d/init.d/functions +. @sysconfdir@/rc.d/init.d/functions SERVICE=virtlockd PROCESS=virtlockd -PIDFILE=::localstatedir::/run/libvirt/lockd/$SERVICE.pid +PIDFILE=@localstatedir@/run/libvirt/lockd/$SERVICE.pid VIRTLOCKD_ARGS= -test -f ::sysconfdir::/sysconfig/virtlockd && . ::sysconfdir::/sysconfig/virtlockd +test -f @sysconfdir@/sysconfig/virtlockd && . @sysconfdir@/sysconfig/virtlockd RETVAL=0 @@ -41,7 +41,7 @@ start() { daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $VIRTLOCKD_ARGS RETVAL=$? echo - [ $RETVAL -eq 0 ] && touch ::localstatedir::/lock/subsys/$SERVICE + [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE } stop() { @@ -51,7 +51,7 @@ stop() { RETVAL=$? echo if [ $RETVAL -eq 0 ]; then - rm -f ::localstatedir::/lock/subsys/$SERVICE + rm -f @localstatedir@/lock/subsys/$SERVICE rm -f $PIDFILE fi } @@ -83,7 +83,7 @@ case "$1" in reload ;; condrestart|try-restart) - [ -f ::localstatedir::/lock/subsys/$SERVICE ] && restart || : + [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || : ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload|try-restart}" diff --git a/tools/Makefile.am b/tools/Makefile.am index 605bf3b..58dbfe7 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,4 +1,4 @@ -## Copyright (C) 2005-2012 Red Hat, Inc. +## Copyright (C) 2005-2013 Red Hat, Inc. ## See COPYING.LIB for the License of this software INCLUDES = \ @@ -58,7 +58,7 @@ dist_man8_MANS = virt-sanlock-cleanup.8 endif virt-xml-validate: virt-xml-validate.in Makefile - $(AM_V_GEN)sed -e 's,[@]SCHEMADIR@,$(pkgdatadir)/schemas,' < $< > $@ \ + $(AM_V_GEN)sed -e 's|[@]schemadir@|$(pkgdatadir)/schemas|' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@ virt-xml-validate.1: virt-xml-validate.in @@ -67,7 +67,7 @@ virt-xml-validate.1: virt-xml-validate.in rm $(srcdir)/$@; exit 1; fi virt-pki-validate: virt-pki-validate.in Makefile - $(AM_V_GEN)sed -e 's,[@]SYSCONFDIR@,$(sysconfdir),' < $< > $@ \ + $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@ virt-pki-validate.1: virt-pki-validate.in @@ -81,8 +81,8 @@ virt-host-validate.1: virt-host-validate.c rm $(srcdir)/$@; exit 1; fi virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile - $(AM_V_GEN)sed -e 's,[@]SYSCONFDIR@,$(sysconfdir),' \ - -e 's,[@]LOCALSTATEDIR@,$(localstatedir),' < $< > $@ \ + $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|' \ + -e 's|[@]localstatedir@|$(localstatedir)|' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@ virt-sanlock-cleanup.8: virt-sanlock-cleanup.in @@ -210,21 +210,21 @@ uninstall-init: endif # LIBVIRT_INIT_SCRIPT_RED_HAT libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's!\@PACKAGE\@!$(PACKAGE)!g' \ - -e 's!\@bindir\@!$(bindir)!g' \ - -e 's!\@localedir\@!$(localedir)!g' \ - -e 's!\@localstatedir\@!$(localstatedir)!g' \ - -e 's!\@sbindir\@!$(sbindir)!g' \ - -e 's!\@sysconfdir\@!$(sysconfdir)!g' \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \ + -e 's|[@]bindir[@]|$(bindir)|g' \ + -e 's|[@]localedir[@]|$(localedir)|g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@ BUILT_SOURCES += libvirt-guests.sh libvirt-guests.init: libvirt-guests.init.in libvirt-guests.sh $(AM_V_GEN)sed \ - -e 's!\@libexecdir\@!$(libexecdir)!g' \ + -e 's|[@]libexecdir[@]|$(libexecdir)|g' \ < $< > $@-t && \ chmod a+x $@-t && \ mv $@-t $@ @@ -251,16 +251,16 @@ uninstall-systemd: endif # LIBVIRT_INIT_SCRIPT_SYSTEMD libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's!\@PACKAGE\@!$(PACKAGE)!g' \ - -e 's!\@bindir\@!$(bindir)!g' \ - -e 's!\@localedir\@!$(localedir)!g' \ - -e 's!\@localstatedir\@!$(localstatedir)!g' \ - -e 's!\@sbindir\@!$(sbindir)!g' \ - -e 's!\@sysconfdir\@!$(sysconfdir)!g' \ - -e 's!\@libexecdir\@!$(libexecdir)!g' \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \ + -e 's|[@]bindir[@]|$(bindir)|g' \ + -e 's|[@]localedir[@]|$(localedir)|g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + -e 's|[@]libexecdir[@]|$(libexecdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@ diff --git a/tools/virt-pki-validate.in b/tools/virt-pki-validate.in index 866a235..2edbf85 100755 --- a/tools/virt-pki-validate.in +++ b/tools/virt-pki-validate.in @@ -25,7 +25,7 @@ echo Found "$CERTOOL" # # Check the directory structure # -SYSCONFDIR="@SYSCONFDIR@" +SYSCONFDIR="@sysconfdir@" PKI="$SYSCONFDIR/pki" if [ ! -d "$PKI" ] then diff --git a/tools/virt-sanlock-cleanup.in b/tools/virt-sanlock-cleanup.in index e143e7d..a9b7c2e 100644 --- a/tools/virt-sanlock-cleanup.in +++ b/tools/virt-sanlock-cleanup.in @@ -10,9 +10,9 @@ fi LOCKSPACE="__LIBVIRT__DISKS__" -LOCKDIR=`augtool print '/files@SYSCONFDIR@/libvirt/qemu-sanlock.conf/disk_lease_dir'` +LOCKDIR=`augtool print '/files@sysconfdir@/libvirt/qemu-sanlock.conf/disk_lease_dir'` if test $? != 0 || "x$LOCKDIR" = "x" ; then - LOCKDIR="@LOCALSTATEDIR@/lib/libvirt/sanlock" + LOCKDIR="@localstatedir@/lib/libvirt/sanlock" fi notify() { @@ -80,7 +80,7 @@ Alternatively report bugs to your software distributor / vendor. =head1 COPYRIGHT -Copyright (C) 2011 Red Hat, Inc. +Copyright (C) 2011, 2013 Red Hat, Inc. =head1 LICENSE diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in index 27ad59e..9c584ed 100644 --- a/tools/virt-xml-validate.in +++ b/tools/virt-xml-validate.in @@ -57,7 +57,7 @@ if [ -z "$TYPE" ]; then esac fi -SCHEMA="@SCHEMADIR@/${TYPE}.rng" +SCHEMA="@schemadir@/${TYPE}.rng" if [ ! -f "$SCHEMA" ]; then echo "$0: schema $SCHEMA does not exist" -- 1.8.0.2

Eric Blake wrote:
We had several different styles of .in conversion in our Makefiles: ALLCAPS, @ALLCAPS@, @lower@, ::lower:: Canonicalize on one form, to make it easier to copy and paste between .in files.
Also, we were using some non-portable sed constructs: \@ is an undefined escape sequence (it happens to be @ itself in GNU sed, but POSIX allows it to mean something else), as well as risky behavior (failure to consistently quote things means a space in $(sysconfdir) could throw things off; also, Autoconf recommends using | rather than , or ! in the s||| operator, because | has to be quoted in shell and is therefore less likely to appear in file names than , or !).
Fix all of these uses to follow the same syntax.
* daemon/libvirtd.8.in: Switch to @var@. * tools/virt-xml-validate.in: Likewise. * tools/virt-pki-validate.in: Likewise. * src/locking/virtlockd.init.in: Likewise. * daemon/Makefile.am: Prefer | over ! in sed. (libvirtd.8): Prefer consistent substitution. (libvirtd.init, libvirtd.service): Avoid non-portable sed. * tools/Makefile.am (libvirt-guests.sh, libvirt-guests.init) (libvirt-guests.service): Likewise. (virt-xml-validate, virt-pki-validate, virt-sanlock-cleanup): Prefer consistent capitalization. * src/Makefile.am (virtlockd.init, virtlockd.service) (virtlockd.socket): Prefer consistent substitution. --- daemon/Makefile.am | 40 +++++++++++++++++----------------- src/Makefile.am | 38 ++++++++++++++++---------------- src/locking/virtlockd.init.in | 14 ++++++------ tools/Makefile.am | 50 +++++++++++++++++++++---------------------- tools/virt-pki-validate.in | 2 +- tools/virt-sanlock-cleanup.in | 6 +++--- tools/virt-xml-validate.in | 2 +-
I missed those last three files in my attempt at this patch, nice catch! ACK. Jim
7 files changed, 76 insertions(+), 76 deletions(-)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 18a4bca..60112ff 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in
-## Copyright (C) 2005-2012 Red Hat, Inc. +## Copyright (C) 2005-2013 Red Hat, Inc. ## See COPYING.LIB for the License of this software
INCLUDES = \ @@ -84,8 +84,8 @@ CLEANFILES += test_libvirtd.aug
libvirtd.8: $(srcdir)/libvirtd.8.in $(AM_V_GEN)sed \ - -e 's!SYSCONFDIR!$(sysconfdir)!g' \ - -e 's!LOCALSTATEDIR!$(localstatedir)!g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@
@@ -181,7 +181,7 @@ endif
libvirtd.policy: libvirtd.policy.in $(top_builddir)/config.status $(AM_V_GEN) sed \ - -e 's![@]authaction[@]!$(policyauth)!g' \ + -e 's|[@]authaction[@]|$(policyauth)|g' \ < $< > $@-t && \ mv $@-t $@ BUILT_SOURCES += libvirtd.policy @@ -222,25 +222,25 @@ BUILT_SOURCES += $(LOGROTATE_CONFS)
libvirtd.logrotate: libvirtd.logrotate.in $(AM_V_GEN)sed \ - -e 's![@]localstatedir[@]!$(localstatedir)!g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in $(AM_V_GEN)sed \ - -e 's![@]localstatedir[@]!$(localstatedir)!g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@
libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in $(AM_V_GEN)sed \ - -e 's![@]localstatedir[@]!$(localstatedir)!g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@
libvirtd.uml.logrotate: libvirtd.uml.logrotate.in $(AM_V_GEN)sed \ - -e 's![@]localstatedir[@]!$(localstatedir)!g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@
@@ -340,21 +340,21 @@ uninstall-init-systemd: endif # LIBVIRT_INIT_SCRIPT_SYSTEMD
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e s!\@localstatedir\@!$(localstatedir)!g \ - -e s!\@sbindir\@!$(sbindir)!g \ - -e s!\@sysconfdir\@!$(sysconfdir)!g \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@
libvirtd.service: libvirtd.service.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e s!\@localstatedir\@!$(localstatedir)!g \ - -e s!\@sbindir\@!$(sbindir)!g \ - -e s!\@sysconfdir\@!$(sysconfdir)!g \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@
diff --git a/src/Makefile.am b/src/Makefile.am index 0cfc1ed..0cc02ed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in
-## Copyright (C) 2005-2012 Red Hat, Inc. +## Copyright (C) 2005-2013 Red Hat, Inc. ## See COPYING.LIB for the License of this software
# No libraries with the exception of LIBXML should be listed @@ -1665,12 +1665,12 @@ uninstall-init:: endif
virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e "s!::localstatedir::!$(localstatedir)!g" \ - -e "s!::sbindir::!$(sbindir)!g" \ - -e "s!::sysconfdir::!$(sysconfdir)!g" \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@
@@ -1706,21 +1706,21 @@ uninstall-systemd: endif
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e "s!::localstatedir::!$(localstatedir)!g" \ - -e "s!::sbindir::!$(sbindir)!g" \ - -e "s!::sysconfdir::!$(sysconfdir)!g" \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@
virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e "s!::localstatedir::!$(localstatedir)!g" \ - -e "s!::sbindir::!$(sbindir)!g" \ - -e "s!::sysconfdir::!$(sysconfdir)!g" \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@
diff --git a/src/locking/virtlockd.init.in b/src/locking/virtlockd.init.in index e55cbf9..1adea07 100644 --- a/src/locking/virtlockd.init.in +++ b/src/locking/virtlockd.init.in @@ -20,19 +20,19 @@ # on virtual machine disk images # # processname: virtlockd -# pidfile: ::localstatedir::/run/libvirt/virtlockd.pid +# pidfile: @localstatedir@/run/libvirt/virtlockd.pid #
# Source function library. -. ::sysconfdir::/rc.d/init.d/functions +. @sysconfdir@/rc.d/init.d/functions
SERVICE=virtlockd PROCESS=virtlockd -PIDFILE=::localstatedir::/run/libvirt/lockd/$SERVICE.pid +PIDFILE=@localstatedir@/run/libvirt/lockd/$SERVICE.pid
VIRTLOCKD_ARGS=
-test -f ::sysconfdir::/sysconfig/virtlockd && . ::sysconfdir::/sysconfig/virtlockd +test -f @sysconfdir@/sysconfig/virtlockd && . @sysconfdir@/sysconfig/virtlockd
RETVAL=0
@@ -41,7 +41,7 @@ start() { daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $VIRTLOCKD_ARGS RETVAL=$? echo - [ $RETVAL -eq 0 ] && touch ::localstatedir::/lock/subsys/$SERVICE + [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE }
stop() { @@ -51,7 +51,7 @@ stop() { RETVAL=$? echo if [ $RETVAL -eq 0 ]; then - rm -f ::localstatedir::/lock/subsys/$SERVICE + rm -f @localstatedir@/lock/subsys/$SERVICE rm -f $PIDFILE fi } @@ -83,7 +83,7 @@ case "$1" in reload ;; condrestart|try-restart) - [ -f ::localstatedir::/lock/subsys/$SERVICE ] && restart || : + [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || : ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload|try-restart}" diff --git a/tools/Makefile.am b/tools/Makefile.am index 605bf3b..58dbfe7 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,4 +1,4 @@ -## Copyright (C) 2005-2012 Red Hat, Inc. +## Copyright (C) 2005-2013 Red Hat, Inc. ## See COPYING.LIB for the License of this software
INCLUDES = \ @@ -58,7 +58,7 @@ dist_man8_MANS = virt-sanlock-cleanup.8 endif
virt-xml-validate: virt-xml-validate.in Makefile - $(AM_V_GEN)sed -e 's,[@]SCHEMADIR@,$(pkgdatadir)/schemas,' < $< > $@ \ + $(AM_V_GEN)sed -e 's|[@]schemadir@|$(pkgdatadir)/schemas|' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@
virt-xml-validate.1: virt-xml-validate.in @@ -67,7 +67,7 @@ virt-xml-validate.1: virt-xml-validate.in rm $(srcdir)/$@; exit 1; fi
virt-pki-validate: virt-pki-validate.in Makefile - $(AM_V_GEN)sed -e 's,[@]SYSCONFDIR@,$(sysconfdir),' < $< > $@ \ + $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@
virt-pki-validate.1: virt-pki-validate.in @@ -81,8 +81,8 @@ virt-host-validate.1: virt-host-validate.c rm $(srcdir)/$@; exit 1; fi
virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile - $(AM_V_GEN)sed -e 's,[@]SYSCONFDIR@,$(sysconfdir),' \ - -e 's,[@]LOCALSTATEDIR@,$(localstatedir),' < $< > $@ \ + $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|' \ + -e 's|[@]localstatedir@|$(localstatedir)|' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@
virt-sanlock-cleanup.8: virt-sanlock-cleanup.in @@ -210,21 +210,21 @@ uninstall-init: endif # LIBVIRT_INIT_SCRIPT_RED_HAT
libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's!\@PACKAGE\@!$(PACKAGE)!g' \ - -e 's!\@bindir\@!$(bindir)!g' \ - -e 's!\@localedir\@!$(localedir)!g' \ - -e 's!\@localstatedir\@!$(localstatedir)!g' \ - -e 's!\@sbindir\@!$(sbindir)!g' \ - -e 's!\@sysconfdir\@!$(sysconfdir)!g' \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \ + -e 's|[@]bindir[@]|$(bindir)|g' \ + -e 's|[@]localedir[@]|$(localedir)|g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@ BUILT_SOURCES += libvirt-guests.sh
libvirt-guests.init: libvirt-guests.init.in libvirt-guests.sh $(AM_V_GEN)sed \ - -e 's!\@libexecdir\@!$(libexecdir)!g' \ + -e 's|[@]libexecdir[@]|$(libexecdir)|g' \ < $< > $@-t && \ chmod a+x $@-t && \ mv $@-t $@ @@ -251,16 +251,16 @@ uninstall-systemd: endif # LIBVIRT_INIT_SCRIPT_SYSTEMD
libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's!\@PACKAGE\@!$(PACKAGE)!g' \ - -e 's!\@bindir\@!$(bindir)!g' \ - -e 's!\@localedir\@!$(localedir)!g' \ - -e 's!\@localstatedir\@!$(localstatedir)!g' \ - -e 's!\@sbindir\@!$(sbindir)!g' \ - -e 's!\@sysconfdir\@!$(sysconfdir)!g' \ - -e 's!\@libexecdir\@!$(libexecdir)!g' \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \ + -e 's|[@]bindir[@]|$(bindir)|g' \ + -e 's|[@]localedir[@]|$(localedir)|g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + -e 's|[@]libexecdir[@]|$(libexecdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@
diff --git a/tools/virt-pki-validate.in b/tools/virt-pki-validate.in index 866a235..2edbf85 100755 --- a/tools/virt-pki-validate.in +++ b/tools/virt-pki-validate.in @@ -25,7 +25,7 @@ echo Found "$CERTOOL" # # Check the directory structure # -SYSCONFDIR="@SYSCONFDIR@" +SYSCONFDIR="@sysconfdir@" PKI="$SYSCONFDIR/pki" if [ ! -d "$PKI" ] then diff --git a/tools/virt-sanlock-cleanup.in b/tools/virt-sanlock-cleanup.in index e143e7d..a9b7c2e 100644 --- a/tools/virt-sanlock-cleanup.in +++ b/tools/virt-sanlock-cleanup.in @@ -10,9 +10,9 @@ fi
LOCKSPACE="__LIBVIRT__DISKS__"
-LOCKDIR=`augtool print '/files@SYSCONFDIR@/libvirt/qemu-sanlock.conf/disk_lease_dir'` +LOCKDIR=`augtool print '/files@sysconfdir@/libvirt/qemu-sanlock.conf/disk_lease_dir'` if test $? != 0 || "x$LOCKDIR" = "x" ; then - LOCKDIR="@LOCALSTATEDIR@/lib/libvirt/sanlock" + LOCKDIR="@localstatedir@/lib/libvirt/sanlock" fi
notify() { @@ -80,7 +80,7 @@ Alternatively report bugs to your software distributor / vendor.
=head1 COPYRIGHT
-Copyright (C) 2011 Red Hat, Inc. +Copyright (C) 2011, 2013 Red Hat, Inc.
=head1 LICENSE
diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in index 27ad59e..9c584ed 100644 --- a/tools/virt-xml-validate.in +++ b/tools/virt-xml-validate.in @@ -57,7 +57,7 @@ if [ -z "$TYPE" ]; then esac fi
-SCHEMA="@SCHEMADIR@/${TYPE}.rng" +SCHEMA="@schemadir@/${TYPE}.rng"
if [ ! -f "$SCHEMA" ]; then echo "$0: schema $SCHEMA does not exist"

On Fri, Jan 04, 2013 at 03:36:45PM -0700, Eric Blake wrote:
We had several different styles of .in conversion in our Makefiles: ALLCAPS, @ALLCAPS@, @lower@, ::lower:: Canonicalize on one form, to make it easier to copy and paste between .in files.
Also, we were using some non-portable sed constructs: \@ is an undefined escape sequence (it happens to be @ itself in GNU sed, but POSIX allows it to mean something else), as well as risky behavior (failure to consistently quote things means a space in $(sysconfdir) could throw things off; also, Autoconf recommends using | rather than , or ! in the s||| operator, because | has to be quoted in shell and is therefore less likely to appear in file names than , or !).
Fix all of these uses to follow the same syntax.
* daemon/libvirtd.8.in: Switch to @var@. * tools/virt-xml-validate.in: Likewise. * tools/virt-pki-validate.in: Likewise. * src/locking/virtlockd.init.in: Likewise. * daemon/Makefile.am: Prefer | over ! in sed. (libvirtd.8): Prefer consistent substitution. (libvirtd.init, libvirtd.service): Avoid non-portable sed. * tools/Makefile.am (libvirt-guests.sh, libvirt-guests.init) (libvirt-guests.service): Likewise. (virt-xml-validate, virt-pki-validate, virt-sanlock-cleanup): Prefer consistent capitalization. * src/Makefile.am (virtlockd.init, virtlockd.service) (virtlockd.socket): Prefer consistent substitution. --- daemon/Makefile.am | 40 +++++++++++++++++----------------- src/Makefile.am | 38 ++++++++++++++++---------------- src/locking/virtlockd.init.in | 14 ++++++------ tools/Makefile.am | 50 +++++++++++++++++++++---------------------- tools/virt-pki-validate.in | 2 +- tools/virt-sanlock-cleanup.in | 6 +++--- tools/virt-xml-validate.in | 2 +- 7 files changed, 76 insertions(+), 76 deletions(-)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 18a4bca..60112ff 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in
-## Copyright (C) 2005-2012 Red Hat, Inc. +## Copyright (C) 2005-2013 Red Hat, Inc. ## See COPYING.LIB for the License of this software
INCLUDES = \ @@ -84,8 +84,8 @@ CLEANFILES += test_libvirtd.aug
libvirtd.8: $(srcdir)/libvirtd.8.in $(AM_V_GEN)sed \ - -e 's!SYSCONFDIR!$(sysconfdir)!g' \ - -e 's!LOCALSTATEDIR!$(localstatedir)!g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@
@@ -181,7 +181,7 @@ endif
libvirtd.policy: libvirtd.policy.in $(top_builddir)/config.status $(AM_V_GEN) sed \ - -e 's![@]authaction[@]!$(policyauth)!g' \ + -e 's|[@]authaction[@]|$(policyauth)|g' \ < $< > $@-t && \ mv $@-t $@ BUILT_SOURCES += libvirtd.policy @@ -222,25 +222,25 @@ BUILT_SOURCES += $(LOGROTATE_CONFS)
libvirtd.logrotate: libvirtd.logrotate.in $(AM_V_GEN)sed \ - -e 's![@]localstatedir[@]!$(localstatedir)!g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in $(AM_V_GEN)sed \ - -e 's![@]localstatedir[@]!$(localstatedir)!g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@
libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in $(AM_V_GEN)sed \ - -e 's![@]localstatedir[@]!$(localstatedir)!g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@
libvirtd.uml.logrotate: libvirtd.uml.logrotate.in $(AM_V_GEN)sed \ - -e 's![@]localstatedir[@]!$(localstatedir)!g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@
@@ -340,21 +340,21 @@ uninstall-init-systemd: endif # LIBVIRT_INIT_SCRIPT_SYSTEMD
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e s!\@localstatedir\@!$(localstatedir)!g \ - -e s!\@sbindir\@!$(sbindir)!g \ - -e s!\@sysconfdir\@!$(sysconfdir)!g \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@
libvirtd.service: libvirtd.service.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e s!\@localstatedir\@!$(localstatedir)!g \ - -e s!\@sbindir\@!$(sbindir)!g \ - -e s!\@sysconfdir\@!$(sysconfdir)!g \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@
diff --git a/src/Makefile.am b/src/Makefile.am index 0cfc1ed..0cc02ed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in
-## Copyright (C) 2005-2012 Red Hat, Inc. +## Copyright (C) 2005-2013 Red Hat, Inc. ## See COPYING.LIB for the License of this software
# No libraries with the exception of LIBXML should be listed @@ -1665,12 +1665,12 @@ uninstall-init:: endif
virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e "s!::localstatedir::!$(localstatedir)!g" \ - -e "s!::sbindir::!$(sbindir)!g" \ - -e "s!::sysconfdir::!$(sysconfdir)!g" \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@
@@ -1706,21 +1706,21 @@ uninstall-systemd: endif
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e "s!::localstatedir::!$(localstatedir)!g" \ - -e "s!::sbindir::!$(sbindir)!g" \ - -e "s!::sysconfdir::!$(sysconfdir)!g" \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@
virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e "s!::localstatedir::!$(localstatedir)!g" \ - -e "s!::sbindir::!$(sbindir)!g" \ - -e "s!::sysconfdir::!$(sysconfdir)!g" \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@
diff --git a/src/locking/virtlockd.init.in b/src/locking/virtlockd.init.in index e55cbf9..1adea07 100644 --- a/src/locking/virtlockd.init.in +++ b/src/locking/virtlockd.init.in @@ -20,19 +20,19 @@ # on virtual machine disk images # # processname: virtlockd -# pidfile: ::localstatedir::/run/libvirt/virtlockd.pid +# pidfile: @localstatedir@/run/libvirt/virtlockd.pid #
# Source function library. -. ::sysconfdir::/rc.d/init.d/functions +. @sysconfdir@/rc.d/init.d/functions
SERVICE=virtlockd PROCESS=virtlockd -PIDFILE=::localstatedir::/run/libvirt/lockd/$SERVICE.pid +PIDFILE=@localstatedir@/run/libvirt/lockd/$SERVICE.pid
VIRTLOCKD_ARGS=
-test -f ::sysconfdir::/sysconfig/virtlockd && . ::sysconfdir::/sysconfig/virtlockd +test -f @sysconfdir@/sysconfig/virtlockd && . @sysconfdir@/sysconfig/virtlockd
RETVAL=0
@@ -41,7 +41,7 @@ start() { daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $VIRTLOCKD_ARGS RETVAL=$? echo - [ $RETVAL -eq 0 ] && touch ::localstatedir::/lock/subsys/$SERVICE + [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE }
stop() { @@ -51,7 +51,7 @@ stop() { RETVAL=$? echo if [ $RETVAL -eq 0 ]; then - rm -f ::localstatedir::/lock/subsys/$SERVICE + rm -f @localstatedir@/lock/subsys/$SERVICE rm -f $PIDFILE fi } @@ -83,7 +83,7 @@ case "$1" in reload ;; condrestart|try-restart) - [ -f ::localstatedir::/lock/subsys/$SERVICE ] && restart || : + [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || : ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload|try-restart}" diff --git a/tools/Makefile.am b/tools/Makefile.am index 605bf3b..58dbfe7 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,4 +1,4 @@ -## Copyright (C) 2005-2012 Red Hat, Inc. +## Copyright (C) 2005-2013 Red Hat, Inc. ## See COPYING.LIB for the License of this software
INCLUDES = \ @@ -58,7 +58,7 @@ dist_man8_MANS = virt-sanlock-cleanup.8 endif
virt-xml-validate: virt-xml-validate.in Makefile - $(AM_V_GEN)sed -e 's,[@]SCHEMADIR@,$(pkgdatadir)/schemas,' < $< > $@ \ + $(AM_V_GEN)sed -e 's|[@]schemadir@|$(pkgdatadir)/schemas|' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@
virt-xml-validate.1: virt-xml-validate.in @@ -67,7 +67,7 @@ virt-xml-validate.1: virt-xml-validate.in rm $(srcdir)/$@; exit 1; fi
virt-pki-validate: virt-pki-validate.in Makefile - $(AM_V_GEN)sed -e 's,[@]SYSCONFDIR@,$(sysconfdir),' < $< > $@ \ + $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@
virt-pki-validate.1: virt-pki-validate.in @@ -81,8 +81,8 @@ virt-host-validate.1: virt-host-validate.c rm $(srcdir)/$@; exit 1; fi
virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile - $(AM_V_GEN)sed -e 's,[@]SYSCONFDIR@,$(sysconfdir),' \ - -e 's,[@]LOCALSTATEDIR@,$(localstatedir),' < $< > $@ \ + $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|' \ + -e 's|[@]localstatedir@|$(localstatedir)|' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@
virt-sanlock-cleanup.8: virt-sanlock-cleanup.in @@ -210,21 +210,21 @@ uninstall-init: endif # LIBVIRT_INIT_SCRIPT_RED_HAT
libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's!\@PACKAGE\@!$(PACKAGE)!g' \ - -e 's!\@bindir\@!$(bindir)!g' \ - -e 's!\@localedir\@!$(localedir)!g' \ - -e 's!\@localstatedir\@!$(localstatedir)!g' \ - -e 's!\@sbindir\@!$(sbindir)!g' \ - -e 's!\@sysconfdir\@!$(sysconfdir)!g' \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \ + -e 's|[@]bindir[@]|$(bindir)|g' \ + -e 's|[@]localedir[@]|$(localedir)|g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@ BUILT_SOURCES += libvirt-guests.sh
libvirt-guests.init: libvirt-guests.init.in libvirt-guests.sh $(AM_V_GEN)sed \ - -e 's!\@libexecdir\@!$(libexecdir)!g' \ + -e 's|[@]libexecdir[@]|$(libexecdir)|g' \ < $< > $@-t && \ chmod a+x $@-t && \ mv $@-t $@ @@ -251,16 +251,16 @@ uninstall-systemd: endif # LIBVIRT_INIT_SCRIPT_SYSTEMD
libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's!\@PACKAGE\@!$(PACKAGE)!g' \ - -e 's!\@bindir\@!$(bindir)!g' \ - -e 's!\@localedir\@!$(localedir)!g' \ - -e 's!\@localstatedir\@!$(localstatedir)!g' \ - -e 's!\@sbindir\@!$(sbindir)!g' \ - -e 's!\@sysconfdir\@!$(sysconfdir)!g' \ - -e 's!\@libexecdir\@!$(libexecdir)!g' \ - < $< > $@-t && \ - chmod a+x $@-t && \ + $(AM_V_GEN)sed \ + -e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \ + -e 's|[@]bindir[@]|$(bindir)|g' \ + -e 's|[@]localedir[@]|$(localedir)|g' \ + -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]sbindir[@]|$(sbindir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + -e 's|[@]libexecdir[@]|$(libexecdir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ mv $@-t $@
diff --git a/tools/virt-pki-validate.in b/tools/virt-pki-validate.in index 866a235..2edbf85 100755 --- a/tools/virt-pki-validate.in +++ b/tools/virt-pki-validate.in @@ -25,7 +25,7 @@ echo Found "$CERTOOL" # # Check the directory structure # -SYSCONFDIR="@SYSCONFDIR@" +SYSCONFDIR="@sysconfdir@" PKI="$SYSCONFDIR/pki" if [ ! -d "$PKI" ] then diff --git a/tools/virt-sanlock-cleanup.in b/tools/virt-sanlock-cleanup.in index e143e7d..a9b7c2e 100644 --- a/tools/virt-sanlock-cleanup.in +++ b/tools/virt-sanlock-cleanup.in @@ -10,9 +10,9 @@ fi
LOCKSPACE="__LIBVIRT__DISKS__"
-LOCKDIR=`augtool print '/files@SYSCONFDIR@/libvirt/qemu-sanlock.conf/disk_lease_dir'` +LOCKDIR=`augtool print '/files@sysconfdir@/libvirt/qemu-sanlock.conf/disk_lease_dir'` if test $? != 0 || "x$LOCKDIR" = "x" ; then - LOCKDIR="@LOCALSTATEDIR@/lib/libvirt/sanlock" + LOCKDIR="@localstatedir@/lib/libvirt/sanlock" fi
notify() { @@ -80,7 +80,7 @@ Alternatively report bugs to your software distributor / vendor.
=head1 COPYRIGHT
-Copyright (C) 2011 Red Hat, Inc. +Copyright (C) 2011, 2013 Red Hat, Inc.
=head1 LICENSE
diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in index 27ad59e..9c584ed 100644 --- a/tools/virt-xml-validate.in +++ b/tools/virt-xml-validate.in @@ -57,7 +57,7 @@ if [ -z "$TYPE" ]; then esac fi
-SCHEMA="@SCHEMADIR@/${TYPE}.rng" +SCHEMA="@schemadir@/${TYPE}.rng"
if [ ! -f "$SCHEMA" ]; then echo "$0: schema $SCHEMA does not exist"
ACK. -- Guido
-- 1.8.0.2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

virtlockd.service could be installed to a configurable root, but virtlockd.socket was hardcoded to installation into a distro. * src/Makefile.am (virtlockd.service, virtlockd.socket): Drop unused substitutions. * src/locking/virtlockd.socket.in (ListenStream): Don't hard-code /var. --- src/Makefile.am | 4 ---- src/locking/virtlockd.socket.in | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 0cc02ed..ba685bb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1707,9 +1707,7 @@ endif virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status $(AM_V_GEN)sed \ - -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ -e 's|[@]sbindir[@]|$(sbindir)|g' \ - -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ < $< > $@-t && \ chmod a+x $@-t && \ mv $@-t $@ @@ -1717,8 +1715,6 @@ virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status $(AM_V_GEN)sed \ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ - -e 's|[@]sbindir[@]|$(sbindir)|g' \ - -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ < $< > $@-t && \ chmod a+x $@-t && \ mv $@-t $@ diff --git a/src/locking/virtlockd.socket.in b/src/locking/virtlockd.socket.in index 0589a29..a6eef4f 100644 --- a/src/locking/virtlockd.socket.in +++ b/src/locking/virtlockd.socket.in @@ -2,7 +2,7 @@ Description=Virtual machine lock manager socket [Socket] -ListenStream=/var/run/libvirt/virtlockd/virtlockd.sock +ListenStream=@localstatedir@/run/libvirt/virtlockd/virtlockd.sock [Install] WantedBy=multi-user.target -- 1.8.0.2

Eric Blake wrote:
virtlockd.service could be installed to a configurable root, but virtlockd.socket was hardcoded to installation into a distro.
* src/Makefile.am (virtlockd.service, virtlockd.socket): Drop unused substitutions. * src/locking/virtlockd.socket.in (ListenStream): Don't hard-code /var. --- src/Makefile.am | 4 ---- src/locking/virtlockd.socket.in | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-)
ACK. Jim
diff --git a/src/Makefile.am b/src/Makefile.am index 0cc02ed..ba685bb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1707,9 +1707,7 @@ endif
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status $(AM_V_GEN)sed \ - -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ -e 's|[@]sbindir[@]|$(sbindir)|g' \ - -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ < $< > $@-t && \ chmod a+x $@-t && \ mv $@-t $@ @@ -1717,8 +1715,6 @@ virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status $(AM_V_GEN)sed \ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ - -e 's|[@]sbindir[@]|$(sbindir)|g' \ - -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ < $< > $@-t && \ chmod a+x $@-t && \ mv $@-t $@ diff --git a/src/locking/virtlockd.socket.in b/src/locking/virtlockd.socket.in index 0589a29..a6eef4f 100644 --- a/src/locking/virtlockd.socket.in +++ b/src/locking/virtlockd.socket.in @@ -2,7 +2,7 @@ Description=Virtual machine lock manager socket
[Socket] -ListenStream=/var/run/libvirt/virtlockd/virtlockd.sock +ListenStream=@localstatedir@/run/libvirt/virtlockd/virtlockd.sock
[Install] WantedBy=multi-user.target

On Fri, Jan 04, 2013 at 03:36:46PM -0700, Eric Blake wrote:
virtlockd.service could be installed to a configurable root, but virtlockd.socket was hardcoded to installation into a distro.
* src/Makefile.am (virtlockd.service, virtlockd.socket): Drop unused substitutions. * src/locking/virtlockd.socket.in (ListenStream): Don't hard-code /var. --- src/Makefile.am | 4 ---- src/locking/virtlockd.socket.in | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 0cc02ed..ba685bb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1707,9 +1707,7 @@ endif
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status $(AM_V_GEN)sed \ - -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ -e 's|[@]sbindir[@]|$(sbindir)|g' \ - -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ < $< > $@-t && \ chmod a+x $@-t && \ mv $@-t $@ @@ -1717,8 +1715,6 @@ virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status $(AM_V_GEN)sed \ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ - -e 's|[@]sbindir[@]|$(sbindir)|g' \ - -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ < $< > $@-t && \ chmod a+x $@-t && \ mv $@-t $@ diff --git a/src/locking/virtlockd.socket.in b/src/locking/virtlockd.socket.in index 0589a29..a6eef4f 100644 --- a/src/locking/virtlockd.socket.in +++ b/src/locking/virtlockd.socket.in @@ -2,7 +2,7 @@ Description=Virtual machine lock manager socket
[Socket] -ListenStream=/var/run/libvirt/virtlockd/virtlockd.sock +ListenStream=@localstatedir@/run/libvirt/virtlockd/virtlockd.sock
[Install] WantedBy=multi-user.target
ACK -- Guido
-- 1.8.0.2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

See also commit 66ff2dd, where we avoided installing these files as executables. * daemon/Makefile.am (libvirtd.service): Drop chmod. * tools/Makefile.am (libvirt-guests.service): Likewise. * src/Makefile.am (virtlockd.service, virtlockd.socket): Likewise. --- daemon/Makefile.am | 1 - src/Makefile.am | 2 -- tools/Makefile.am | 1 - 3 files changed, 4 deletions(-) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 60112ff..7bcc7e2 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -354,7 +354,6 @@ libvirtd.service: libvirtd.service.in $(top_builddir)/config.status -e 's|[@]sbindir[@]|$(sbindir)|g' \ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ < $< > $@-t && \ - chmod a+x $@-t && \ mv $@-t $@ diff --git a/src/Makefile.am b/src/Makefile.am index ba685bb..08611fb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1709,14 +1709,12 @@ virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status $(AM_V_GEN)sed \ -e 's|[@]sbindir[@]|$(sbindir)|g' \ < $< > $@-t && \ - chmod a+x $@-t && \ mv $@-t $@ virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status $(AM_V_GEN)sed \ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ - chmod a+x $@-t && \ mv $@-t $@ diff --git a/tools/Makefile.am b/tools/Makefile.am index 58dbfe7..3775914 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -260,7 +260,6 @@ libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ -e 's|[@]libexecdir[@]|$(libexecdir)|g' \ < $< > $@-t && \ - chmod a+x $@-t && \ mv $@-t $@ -- 1.8.0.2

Eric Blake wrote:
See also commit 66ff2dd, where we avoided installing these files as executables.
* daemon/Makefile.am (libvirtd.service): Drop chmod. * tools/Makefile.am (libvirt-guests.service): Likewise. * src/Makefile.am (virtlockd.service, virtlockd.socket): Likewise. --- daemon/Makefile.am | 1 - src/Makefile.am | 2 -- tools/Makefile.am | 1 - 3 files changed, 4 deletions(-)
ACK. Jim
diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 60112ff..7bcc7e2 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -354,7 +354,6 @@ libvirtd.service: libvirtd.service.in $(top_builddir)/config.status -e 's|[@]sbindir[@]|$(sbindir)|g' \ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ < $< > $@-t && \ - chmod a+x $@-t && \ mv $@-t $@
diff --git a/src/Makefile.am b/src/Makefile.am index ba685bb..08611fb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1709,14 +1709,12 @@ virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status $(AM_V_GEN)sed \ -e 's|[@]sbindir[@]|$(sbindir)|g' \ < $< > $@-t && \ - chmod a+x $@-t && \ mv $@-t $@
virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status $(AM_V_GEN)sed \ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ - chmod a+x $@-t && \ mv $@-t $@
diff --git a/tools/Makefile.am b/tools/Makefile.am index 58dbfe7..3775914 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -260,7 +260,6 @@ libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ -e 's|[@]libexecdir[@]|$(libexecdir)|g' \ < $< > $@-t && \ - chmod a+x $@-t && \ mv $@-t $@

On Fri, Jan 04, 2013 at 03:36:47PM -0700, Eric Blake wrote:
See also commit 66ff2dd, where we avoided installing these files as executables.
* daemon/Makefile.am (libvirtd.service): Drop chmod. * tools/Makefile.am (libvirt-guests.service): Likewise. * src/Makefile.am (virtlockd.service, virtlockd.socket): Likewise. --- daemon/Makefile.am | 1 - src/Makefile.am | 2 -- tools/Makefile.am | 1 - 3 files changed, 4 deletions(-)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 60112ff..7bcc7e2 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -354,7 +354,6 @@ libvirtd.service: libvirtd.service.in $(top_builddir)/config.status -e 's|[@]sbindir[@]|$(sbindir)|g' \ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ < $< > $@-t && \ - chmod a+x $@-t && \ mv $@-t $@
diff --git a/src/Makefile.am b/src/Makefile.am index ba685bb..08611fb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1709,14 +1709,12 @@ virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status $(AM_V_GEN)sed \ -e 's|[@]sbindir[@]|$(sbindir)|g' \ < $< > $@-t && \ - chmod a+x $@-t && \ mv $@-t $@
virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status $(AM_V_GEN)sed \ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ - chmod a+x $@-t && \ mv $@-t $@
diff --git a/tools/Makefile.am b/tools/Makefile.am index 58dbfe7..3775914 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -260,7 +260,6 @@ libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ -e 's|[@]libexecdir[@]|$(libexecdir)|g' \ < $< > $@-t && \ - chmod a+x $@-t && \ mv $@-t $@
Now I see what you meant on your reply to my change. ACK. -- Guido
-- 1.8.0.2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

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. --- daemon/Makefile.am | 10 ++++++---- libvirt.spec.in | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 7bcc7e2..c59084c 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -273,14 +273,16 @@ uninstall-sysconfig: rmdir $(DESTDIR)$(sysconfdir)/sysconfig || : if WITH_SYSCTL +# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on +# /usr/lib/sysctl.d/ even when libdir is /usr/lib64 install-sysctl: - $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysctl.d + $(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d $(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \ - $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd + $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf uninstall-sysctl: - rm -f $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd - rmdir $(DESTDIR)$(sysconfdir)/sysctl.d || : + rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf + rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || : else install-sysctl: uninstall-sysctl: diff --git a/libvirt.spec.in b/libvirt.spec.in index 3aaef02..0a5a8e0 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1681,9 +1681,9 @@ fi %config(noreplace) %{_sysconfdir}/sysconfig/virtlockd %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf %if 0%{?fedora} >= 14 || 0%{?rhel} >= 6 -%config(noreplace) %{_sysconfdir}/sysctl.d/libvirtd +%config(noreplace) %{_prefix}/lib/sysctl.d/libvirtd.conf %else -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd +rm -f $RPM_BUILD_ROOT%{_prefix}/lib/sysctl.d/libvirtd.conf %endif %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/ %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/ -- 1.8.0.2

Eric Blake wrote:
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. --- daemon/Makefile.am | 10 ++++++---- libvirt.spec.in | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-)
I didn't test this one in my rpm builds, but looks good to me. ACK. Jim
diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 7bcc7e2..c59084c 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -273,14 +273,16 @@ uninstall-sysconfig: rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
if WITH_SYSCTL +# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on +# /usr/lib/sysctl.d/ even when libdir is /usr/lib64 install-sysctl: - $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysctl.d + $(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d $(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \ - $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd + $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
uninstall-sysctl: - rm -f $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd - rmdir $(DESTDIR)$(sysconfdir)/sysctl.d || : + rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf + rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || : else install-sysctl: uninstall-sysctl: diff --git a/libvirt.spec.in b/libvirt.spec.in index 3aaef02..0a5a8e0 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1681,9 +1681,9 @@ fi %config(noreplace) %{_sysconfdir}/sysconfig/virtlockd %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf %if 0%{?fedora} >= 14 || 0%{?rhel} >= 6 -%config(noreplace) %{_sysconfdir}/sysctl.d/libvirtd +%config(noreplace) %{_prefix}/lib/sysctl.d/libvirtd.conf %else -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd +rm -f $RPM_BUILD_ROOT%{_prefix}/lib/sysctl.d/libvirtd.conf %endif %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/ %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/

On 01/05/2013 11:27 AM, Jim Fehlig wrote:
Eric Blake wrote:
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. --- daemon/Makefile.am | 10 ++++++---- libvirt.spec.in | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-)
I didn't test this one in my rpm builds, but looks good to me.
ACK.
Thanks for the reviews; I've gone ahead and pushed the series now (trusting that my testing via autobuild.sh is sufficient for this one). I am also in the process of backporting these to v0.10.2-maint, since that is the version used by F18 where the bug report was first raised. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (3)
-
Eric Blake
-
Guido Günther
-
Jim Fehlig