]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: don't hardcode /etc in the config related files
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 18 Jul 2019 15:17:07 +0000 (16:17 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 9 Aug 2019 13:06:31 +0000 (14:06 +0100)
Substitute in the @sysconfigdir@ value instead of /etc.

Reviewed-by: Christophe de Dinechin <dinechin@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
15 files changed:
src/locking/Makefile.inc.am
src/locking/virtlockd.service.in
src/logging/Makefile.inc.am
src/logging/virtlogd.service.in
src/remote/Makefile.inc.am
src/remote/libvirtd-admin.socket.in
src/remote/libvirtd-ro.socket.in
src/remote/libvirtd-tcp.socket.in
src/remote/libvirtd-tls.socket.in
src/remote/libvirtd.aug.in
src/remote/libvirtd.conf.in
src/remote/libvirtd.service.in
src/remote/libvirtd.socket.in
src/remote/test_libvirtd.aug.in
tools/libvirt-guests.service.in

index 161410051c549f75e79ee8f10695ab1c249423c0..bc1a05549a7f7d5dc6f6ebe51c98a3eaad1c55ba 100644 (file)
@@ -258,6 +258,7 @@ locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
 virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
        $(AM_V_GEN)sed \
            -e 's|[@]sbindir[@]|$(sbindir)|g' \
+           -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
            < $< > $@-t && \
            mv $@-t $@
 
index 3c9d587032078037f05356a8bc3e47c0b6b08217..e7f8057c06b4d538a2bf69ea67d478b16c2f0146 100644 (file)
@@ -7,7 +7,7 @@ Documentation=man:virtlockd(8)
 Documentation=https://libvirt.org
 
 [Service]
-EnvironmentFile=-/etc/sysconfig/virtlockd
+EnvironmentFile=-@sysconfdir@/sysconfig/virtlockd
 ExecStart=@sbindir@/virtlockd $VIRTLOCKD_ARGS
 ExecReload=/bin/kill -USR1 $MAINPID
 # Loosing the locks is a really bad thing that will
index f0c49330f5b0cbf54858551ae3b220eccd00f0e9..18772fde2f2aeecacd01f89a5b2417efa7abe5a9 100644 (file)
@@ -122,6 +122,7 @@ virtlogd.8.in: logging/virtlogd.pod
 virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
        $(AM_V_GEN)sed \
            -e 's|[@]sbindir[@]|$(sbindir)|g' \
+           -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
            < $< > $@-t && \
            mv $@-t $@
 
index 3d9ae36150dced9912e998ab6ef8d7ec227b696b..daff48e67d833a2e254287c58746d8a4f463a92d 100644 (file)
@@ -7,7 +7,7 @@ Documentation=man:virtlogd(8)
 Documentation=https://libvirt.org
 
 [Service]
-EnvironmentFile=-/etc/sysconfig/virtlogd
+EnvironmentFile=-@sysconfdir@/sysconfig/virtlogd
 ExecStart=@sbindir@/virtlogd $VIRTLOGD_ARGS
 ExecReload=/bin/kill -USR1 $MAINPID
 # Loosing the logs is a really bad thing that will
index 9d0adb6d8c66dbd9e3a58f53edda19cbd0618161..9dc27361fd5f6685dde597e612f06ecb1ebdcc31 100644 (file)
@@ -194,6 +194,7 @@ remote/libvirtd.conf: remote/libvirtd.conf.in
        $(AM_V_GEN)$(SED) \
                -e '/[@]CUT_ENABLE_IP[@]/d' \
                -e '/[@]END[@]/d' \
+               -e 's|[@]sysconfdir[@]|@sysconfdir@|' \
                -e 's|[@]DAEMON_NAME[@]|libvirtd|' \
                $< > $@
 
@@ -209,6 +210,7 @@ remote/libvirtd.aug: remote/libvirtd.aug.in
        $(AM_V_GEN)$(SED) \
                -e '/[@]CUT_ENABLE_IP[@]/d' \
                -e '/[@]END[@]/d' \
+               -e 's|[@]sysconfdir[@]|@sysconfdir@|' \
                -e 's|[@]DAEMON_NAME[@]|libvirtd|' \
                -e 's|[@]DAEMON_NAME_UC[@]|Libvirtd|' \
                $< > $@
@@ -220,6 +222,7 @@ remote/test_libvirtd.aug: remote/test_libvirtd.aug.in \
                $(SED) \
                -e '/[@]CUT_ENABLE_IP[@]/d' \
                -e '/[@]END[@]/d' \
+               -e 's|[@]sysconfdir[@]|@sysconfdir@|' \
                -e 's|[@]DAEMON_NAME[@]|libvirtd|' \
                -e 's|[@]DAEMON_NAME_UC[@]|Libvirtd|' \
                > $@ || rm -f $@
@@ -301,30 +304,35 @@ libvirtd.service: remote/libvirtd.service.in $(top_builddir)/config.status
 libvirtd.socket: remote/libvirtd.socket.in $(top_builddir)/config.status
        $(AM_V_GEN)sed \
            -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+           -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
            < $< > $@-t && \
            mv $@-t $@
 
 libvirtd-ro.socket: remote/libvirtd-ro.socket.in $(top_builddir)/config.status
        $(AM_V_GEN)sed \
            -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+           -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
            < $< > $@-t && \
            mv $@-t $@
 
 libvirtd-admin.socket: remote/libvirtd-admin.socket.in $(top_builddir)/config.status
        $(AM_V_GEN)sed \
            -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+           -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
            < $< > $@-t && \
            mv $@-t $@
 
 libvirtd-tcp.socket: remote/libvirtd-tcp.socket.in $(top_builddir)/config.status
        $(AM_V_GEN)sed \
            -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+           -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
            < $< > $@-t && \
            mv $@-t $@
 
 libvirtd-tls.socket: remote/libvirtd-tls.socket.in $(top_builddir)/config.status
        $(AM_V_GEN)sed \
            -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+           -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
            < $< > $@-t && \
            mv $@-t $@
 
index 307c9ba24bbb1cce84bc0d7087d9e2a18c38aacd..bbab4ea355fd9738d23e5d2557c128ae3da8534a 100644 (file)
@@ -5,7 +5,7 @@ BindsTo=libvirtd.socket
 After=libvirtd.socket
 
 [Socket]
-# The directory must match the /etc/libvirt/libvirtd.conf unix_sock_dir setting
+# The directory must match the @sysconfdir@/libvirt/libvirtd.conf unix_sock_dir setting
 # when using systemd version < 227
 ListenStream=@localstatedir@/run/libvirt/libvirt-admin-sock
 Service=libvirtd.service
index 876daf0c9cfa11887f8521d6340e22c67da7c88f..5f8b1892d59a7668051b18ab0c40ef17f001b009 100644 (file)
@@ -5,7 +5,7 @@ BindsTo=libvirtd.socket
 After=libvirtd.socket
 
 [Socket]
-# The directory must match the /etc/libvirt/libvirtd.conf unix_sock_dir setting
+# The directory must match the @sysconfdir@/libvirt/libvirtd.conf unix_sock_dir setting
 # when using systemd version < 227
 ListenStream=@localstatedir@/run/libvirt/libvirt-sock-ro
 Service=libvirtd.service
index 16a47642834ed27f11939f6591403fe5725ad9a5..1103036c45af39bec7e367d9b9b0cc950c5cfc72 100644 (file)
@@ -5,7 +5,7 @@ BindsTo=libvirtd.socket
 After=libvirtd.socket
 
 [Socket]
-# This must match the /etc/libvirt/libvirtd.conf tcp_port setting
+# This must match the @sysconfdir@/libvirt/libvirtd.conf tcp_port setting
 # when using systemd version < 227
 ListenStream=16509
 Service=libvirtd.service
index e904583cf9f10fc916ccc7dee71fcd4f73a488b7..e2b1f839dee9c8c6131de7490f124f500b3fafa5 100644 (file)
@@ -5,7 +5,7 @@ BindsTo=libvirtd.socket
 After=libvirtd.socket
 
 [Socket]
-# This must match the /etc/libvirt/libvirtd.conf tls_port setting
+# This must match the @sysconfdir@/libvirt/libvirtd.conf tls_port setting
 # when using systemd version < 227
 ListenStream=16514
 Service=libvirtd.service
index eec3433f293a3ee516a8ba34e0b2aa305337d0cc..23a01c41e2f5d683b0b3b3b3a146a1cde9215d11 100644 (file)
@@ -1,4 +1,4 @@
-(* /etc/libvirt/@DAEMON_NAME@.conf *)
+(* @sysconfdir@/libvirt/@DAEMON_NAME@.conf *)
 
 module @DAEMON_NAME_UC@ =
    autoload xfm
@@ -114,7 +114,7 @@ module @DAEMON_NAME_UC@ =
 
    let lns = ( record | comment | empty ) *
 
-   let filter = incl "/etc/libvirt/@DAEMON_NAME@.conf"
+   let filter = incl "@sysconfdir@/libvirt/@DAEMON_NAME@.conf"
               . Util.stdexcl
 
    let xfm = transform lns filter
index e351a8c19010f210c2853ed28f94c6f2af88a76d..696999830642f0db0a1d51671acb78e4f09a312e 100644 (file)
 #          the network providing auth (eg, TLS/x509 certificates)
 #
 #  - sasl: use SASL infrastructure. The actual auth scheme is then
-#          controlled from /etc/sasl2/libvirt.conf. For the TCP
+#          controlled from @sysconfdir@/sasl2/libvirt.conf. For the TCP
 #          socket only GSSAPI & DIGEST-MD5 mechanisms will be used.
 #          For non-TCP or TLS sockets, any scheme is allowed.
 #
 # If you don't enable SASL, then all TCP traffic is cleartext.
 # Don't do this outside of a dev/test scenario. For real world
 # use, always enable SASL and use the GSSAPI or DIGEST-MD5
-# mechanism in /etc/sasl2/libvirt.conf
+# mechanism in @sysconfdir@/sasl2/libvirt.conf
 #auth_tcp = "sasl"
 
 # Change the authentication scheme for TLS sockets.
 # Use of TLS requires that x509 certificates be issued. The default locations
 # for the certificate files is as follows:
 #
-#   /etc/pki/CA/cacert.pem                 - The CA master certificate
-#   /etc/pki/libvirt/servercert.pem        - The server certificate signed with
-#                                            the cacert.pem
-#   /etc/pki/libvirt/private/serverkey.pem - The server private key
+#   @sysconfdir@/pki/CA/cacert.pem - The CA master certificate
+#   @sysconfdir@/pki/libvirt/servercert.pem - The server certificate signed by cacert.pem
+#   @sysconfdir@/pki/libvirt/private/serverkey.pem - The server private key
 #
 # It is possible to override the default locations by altering the 'key_file',
 # 'cert_file', and 'ca_file' values and uncommenting them below.
 
 # Override the default server key file path
 #
-#key_file = "/etc/pki/libvirt/private/serverkey.pem"
+#key_file = "@sysconfdir@/pki/libvirt/private/serverkey.pem"
 
 # Override the default server certificate file path
 #
-#cert_file = "/etc/pki/libvirt/servercert.pem"
+#cert_file = "@sysconfdir@/pki/libvirt/servercert.pem"
 
 # Override the default CA certificate path
 #
-#ca_file = "/etc/pki/CA/cacert.pem"
+#ca_file = "@sysconfdir@/pki/CA/cacert.pem"
 
 # Specify a certificate revocation list.
 #
 # Defaults to not using a CRL, uncomment to enable it
-#crl_file = "/etc/pki/CA/crl.pem"
+#crl_file = "@sysconfdir@/pki/CA/crl.pem"
 
 
 
index 5dbe7cbe72adf8af58db66c70f39beb2a5591538..4c5b28b47883b59cd1f9d0edf22c67ca4aa60d5a 100644 (file)
@@ -22,7 +22,7 @@ Documentation=https://libvirt.org
 
 [Service]
 Type=notify
-EnvironmentFile=-/etc/sysconfig/libvirtd
+EnvironmentFile=-@sysconfdir@/sysconfig/libvirtd
 # libvirtd.service is set to run on boot so that autostart of
 # VMs can be performed. We don't want it to stick around if
 # unused though, so we set a timeout. The socket activation
index 2ee4d7d7a2c84f67a97f0e4b91b35166a00bf44c..872f70eb21b5ba4428a2daac53a08661a7bfd1aa 100644 (file)
@@ -3,7 +3,7 @@ Description=Libvirt local socket
 Before=libvirtd.service
 
 [Socket]
-# The directory must match the /etc/libvirt/libvirtd.conf unix_sock_dir setting
+# The directory must match the @sysconfdir@/libvirt/libvirtd.conf unix_sock_dir setting
 # when using systemd version < 227
 ListenStream=@localstatedir@/run/libvirt/libvirt-sock
 Service=libvirtd.service
index 2fd809af4af7ddb693e7aa00f88ce2131d029ec4..fc9fb69b6700311690423c2bdaae5c669ae0726d 100644 (file)
@@ -24,10 +24,10 @@ module Test_@DAEMON_NAME@ =
              { "1" = "polkit" }
         }
 @CUT_ENABLE_IP@
-        { "key_file" = "/etc/pki/libvirt/private/serverkey.pem" }
-        { "cert_file" = "/etc/pki/libvirt/servercert.pem" }
-        { "ca_file" = "/etc/pki/CA/cacert.pem" }
-        { "crl_file" = "/etc/pki/CA/crl.pem" }
+        { "key_file" = "@sysconfdir@/pki/libvirt/private/serverkey.pem" }
+        { "cert_file" = "@sysconfdir@/pki/libvirt/servercert.pem" }
+        { "ca_file" = "@sysconfdir@/pki/CA/cacert.pem" }
+        { "crl_file" = "@sysconfdir@/pki/CA/crl.pem" }
         { "tls_no_sanity_certificate" = "1" }
         { "tls_no_verify_certificate" = "1" }
         { "tls_allowed_dn_list"
index 491ca62138a8735e92dd3be63c9c5bf84f05c65e..10c664016ade632c45b85b03a0f68071bcf08dbc 100644 (file)
@@ -10,7 +10,7 @@ Documentation=man:libvirtd(8)
 Documentation=https://libvirt.org
 
 [Service]
-EnvironmentFile=-/etc/sysconfig/libvirt-guests
+EnvironmentFile=-@sysconfdir@/sysconfig/libvirt-guests
 # Hack just call traditional service until we factor
 # out the code
 ExecStart=@libexecdir@/libvirt-guests.sh start