Substitute in the @sysconfigdir@ value instead of /etc.
Reviewed-by: Christophe de Dinechin <dinechin(a)redhat.com>
Reviewed-by: Andrea Bolognani <abologna(a)redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/locking/Makefile.inc.am | 1 +
src/locking/virtlockd.service.in | 2 +-
src/logging/Makefile.inc.am | 1 +
src/logging/virtlogd.service.in | 2 +-
src/remote/Makefile.inc.am | 8 ++++++++
src/remote/libvirtd-admin.socket.in | 2 +-
src/remote/libvirtd-ro.socket.in | 2 +-
src/remote/libvirtd-tcp.socket.in | 2 +-
src/remote/libvirtd-tls.socket.in | 2 +-
src/remote/libvirtd.aug.in | 4 ++--
src/remote/libvirtd.conf.in | 20 ++++++++++----------
src/remote/libvirtd.service.in | 2 +-
src/remote/libvirtd.socket.in | 2 +-
src/remote/test_libvirtd.aug.in | 8 ++++----
tools/libvirt-guests.service.in | 2 +-
15 files changed, 35 insertions(+), 25 deletions(-)
diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am
index 161410051c..bc1a05549a 100644
--- a/src/locking/Makefile.inc.am
+++ b/src/locking/Makefile.inc.am
@@ -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 $@
diff --git a/src/locking/virtlockd.service.in b/src/locking/virtlockd.service.in
index 3c9d587032..e7f8057c06 100644
--- a/src/locking/virtlockd.service.in
+++ b/src/locking/virtlockd.service.in
@@ -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
diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am
index f0c49330f5..18772fde2f 100644
--- a/src/logging/Makefile.inc.am
+++ b/src/logging/Makefile.inc.am
@@ -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 $@
diff --git a/src/logging/virtlogd.service.in b/src/logging/virtlogd.service.in
index 3d9ae36150..daff48e67d 100644
--- a/src/logging/virtlogd.service.in
+++ b/src/logging/virtlogd.service.in
@@ -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
diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am
index 9d0adb6d8c..9dc27361fd 100644
--- a/src/remote/Makefile.inc.am
+++ b/src/remote/Makefile.inc.am
@@ -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 $@
diff --git a/src/remote/libvirtd-admin.socket.in b/src/remote/libvirtd-admin.socket.in
index 307c9ba24b..bbab4ea355 100644
--- a/src/remote/libvirtd-admin.socket.in
+++ b/src/remote/libvirtd-admin.socket.in
@@ -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(a)/libvirt/libvirtd.conf unix_sock_dir setting
# when using systemd version < 227
ListenStream=@localstatedir@/run/libvirt/libvirt-admin-sock
Service=libvirtd.service
diff --git a/src/remote/libvirtd-ro.socket.in b/src/remote/libvirtd-ro.socket.in
index 876daf0c9c..5f8b1892d5 100644
--- a/src/remote/libvirtd-ro.socket.in
+++ b/src/remote/libvirtd-ro.socket.in
@@ -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(a)/libvirt/libvirtd.conf unix_sock_dir setting
# when using systemd version < 227
ListenStream=@localstatedir@/run/libvirt/libvirt-sock-ro
Service=libvirtd.service
diff --git a/src/remote/libvirtd-tcp.socket.in b/src/remote/libvirtd-tcp.socket.in
index 16a4764283..1103036c45 100644
--- a/src/remote/libvirtd-tcp.socket.in
+++ b/src/remote/libvirtd-tcp.socket.in
@@ -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(a)/libvirt/libvirtd.conf tcp_port setting
# when using systemd version < 227
ListenStream=16509
Service=libvirtd.service
diff --git a/src/remote/libvirtd-tls.socket.in b/src/remote/libvirtd-tls.socket.in
index e904583cf9..e2b1f839de 100644
--- a/src/remote/libvirtd-tls.socket.in
+++ b/src/remote/libvirtd-tls.socket.in
@@ -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(a)/libvirt/libvirtd.conf tls_port setting
# when using systemd version < 227
ListenStream=16514
Service=libvirtd.service
diff --git a/src/remote/libvirtd.aug.in b/src/remote/libvirtd.aug.in
index eec3433f29..23a01c41e2 100644
--- a/src/remote/libvirtd.aug.in
+++ b/src/remote/libvirtd.aug.in
@@ -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
diff --git a/src/remote/libvirtd.conf.in b/src/remote/libvirtd.conf.in
index e351a8c190..a0fb634607 100644
--- a/src/remote/libvirtd.conf.in
+++ b/src/remote/libvirtd.conf.in
@@ -134,7 +134,7 @@
# 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(a)/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.
#
@@ -166,7 +166,7 @@
# 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(a)/sasl2/libvirt.conf
#auth_tcp = "sasl"
# Change the authentication scheme for TLS sockets.
@@ -199,10 +199,10 @@
# 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(a)/pki/CA/cacert.pem - The CA master certificate
+# @sysconfdir(a)/pki/libvirt/servercert.pem - The server certificate signed with
+# the cacert.pem
+# @sysconfdir(a)/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.
@@ -213,20 +213,20 @@
# Override the default server key file path
#
-#key_file = "/etc/pki/libvirt/private/serverkey.pem"
+#key_file = "@sysconfdir(a)/pki/libvirt/private/serverkey.pem"
# Override the default server certificate file path
#
-#cert_file = "/etc/pki/libvirt/servercert.pem"
+#cert_file = "@sysconfdir(a)/pki/libvirt/servercert.pem"
# Override the default CA certificate path
#
-#ca_file = "/etc/pki/CA/cacert.pem"
+#ca_file = "@sysconfdir(a)/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(a)/pki/CA/crl.pem"
diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in
index 5dbe7cbe72..4c5b28b478 100644
--- a/src/remote/libvirtd.service.in
+++ b/src/remote/libvirtd.service.in
@@ -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
diff --git a/src/remote/libvirtd.socket.in b/src/remote/libvirtd.socket.in
index 2ee4d7d7a2..872f70eb21 100644
--- a/src/remote/libvirtd.socket.in
+++ b/src/remote/libvirtd.socket.in
@@ -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(a)/libvirt/libvirtd.conf unix_sock_dir setting
# when using systemd version < 227
ListenStream=@localstatedir@/run/libvirt/libvirt-sock
Service=libvirtd.service
diff --git a/src/remote/test_libvirtd.aug.in b/src/remote/test_libvirtd.aug.in
index 2fd809af4a..fc9fb69b67 100644
--- a/src/remote/test_libvirtd.aug.in
+++ b/src/remote/test_libvirtd.aug.in
@@ -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(a)/pki/libvirt/private/serverkey.pem" }
+ { "cert_file" = "@sysconfdir(a)/pki/libvirt/servercert.pem" }
+ { "ca_file" = "@sysconfdir(a)/pki/CA/cacert.pem" }
+ { "crl_file" = "@sysconfdir(a)/pki/CA/crl.pem" }
{ "tls_no_sanity_certificate" = "1" }
{ "tls_no_verify_certificate" = "1" }
{ "tls_allowed_dn_list"
diff --git a/tools/libvirt-guests.service.in b/tools/libvirt-guests.service.in
index 491ca62138..10c664016a 100644
--- a/tools/libvirt-guests.service.in
+++ b/tools/libvirt-guests.service.in
@@ -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(a)/libvirt-guests.sh start
--
2.21.0