build: don't hardcode /etc in the config related files

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>
This commit is contained in:
Daniel P. Berrangé 2019-07-18 16:17:07 +01:00
parent 22437d06cd
commit 5b816e1696
15 changed files with 34 additions and 25 deletions

View File

@ -258,6 +258,7 @@ locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
$(AM_V_GEN)sed \ $(AM_V_GEN)sed \
-e 's|[@]sbindir[@]|$(sbindir)|g' \ -e 's|[@]sbindir[@]|$(sbindir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \ < $< > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@ -7,7 +7,7 @@ Documentation=man:virtlockd(8)
Documentation=https://libvirt.org Documentation=https://libvirt.org
[Service] [Service]
EnvironmentFile=-/etc/sysconfig/virtlockd EnvironmentFile=-@sysconfdir@/sysconfig/virtlockd
ExecStart=@sbindir@/virtlockd $VIRTLOCKD_ARGS ExecStart=@sbindir@/virtlockd $VIRTLOCKD_ARGS
ExecReload=/bin/kill -USR1 $MAINPID ExecReload=/bin/kill -USR1 $MAINPID
# Loosing the locks is a really bad thing that will # Loosing the locks is a really bad thing that will

View File

@ -122,6 +122,7 @@ virtlogd.8.in: logging/virtlogd.pod
virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
$(AM_V_GEN)sed \ $(AM_V_GEN)sed \
-e 's|[@]sbindir[@]|$(sbindir)|g' \ -e 's|[@]sbindir[@]|$(sbindir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \ < $< > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@ -7,7 +7,7 @@ Documentation=man:virtlogd(8)
Documentation=https://libvirt.org Documentation=https://libvirt.org
[Service] [Service]
EnvironmentFile=-/etc/sysconfig/virtlogd EnvironmentFile=-@sysconfdir@/sysconfig/virtlogd
ExecStart=@sbindir@/virtlogd $VIRTLOGD_ARGS ExecStart=@sbindir@/virtlogd $VIRTLOGD_ARGS
ExecReload=/bin/kill -USR1 $MAINPID ExecReload=/bin/kill -USR1 $MAINPID
# Loosing the logs is a really bad thing that will # Loosing the logs is a really bad thing that will

View File

@ -194,6 +194,7 @@ remote/libvirtd.conf: remote/libvirtd.conf.in
$(AM_V_GEN)$(SED) \ $(AM_V_GEN)$(SED) \
-e '/[@]CUT_ENABLE_IP[@]/d' \ -e '/[@]CUT_ENABLE_IP[@]/d' \
-e '/[@]END[@]/d' \ -e '/[@]END[@]/d' \
-e 's|[@]sysconfdir[@]|@sysconfdir@|' \
-e 's|[@]DAEMON_NAME[@]|libvirtd|' \ -e 's|[@]DAEMON_NAME[@]|libvirtd|' \
$< > $@ $< > $@
@ -209,6 +210,7 @@ remote/libvirtd.aug: remote/libvirtd.aug.in
$(AM_V_GEN)$(SED) \ $(AM_V_GEN)$(SED) \
-e '/[@]CUT_ENABLE_IP[@]/d' \ -e '/[@]CUT_ENABLE_IP[@]/d' \
-e '/[@]END[@]/d' \ -e '/[@]END[@]/d' \
-e 's|[@]sysconfdir[@]|@sysconfdir@|' \
-e 's|[@]DAEMON_NAME[@]|libvirtd|' \ -e 's|[@]DAEMON_NAME[@]|libvirtd|' \
-e 's|[@]DAEMON_NAME_UC[@]|Libvirtd|' \ -e 's|[@]DAEMON_NAME_UC[@]|Libvirtd|' \
$< > $@ $< > $@
@ -220,6 +222,7 @@ remote/test_libvirtd.aug: remote/test_libvirtd.aug.in \
$(SED) \ $(SED) \
-e '/[@]CUT_ENABLE_IP[@]/d' \ -e '/[@]CUT_ENABLE_IP[@]/d' \
-e '/[@]END[@]/d' \ -e '/[@]END[@]/d' \
-e 's|[@]sysconfdir[@]|@sysconfdir@|' \
-e 's|[@]DAEMON_NAME[@]|libvirtd|' \ -e 's|[@]DAEMON_NAME[@]|libvirtd|' \
-e 's|[@]DAEMON_NAME_UC[@]|Libvirtd|' \ -e 's|[@]DAEMON_NAME_UC[@]|Libvirtd|' \
> $@ || rm -f $@ > $@ || 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 libvirtd.socket: remote/libvirtd.socket.in $(top_builddir)/config.status
$(AM_V_GEN)sed \ $(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \ < $< > $@-t && \
mv $@-t $@ mv $@-t $@
libvirtd-ro.socket: remote/libvirtd-ro.socket.in $(top_builddir)/config.status libvirtd-ro.socket: remote/libvirtd-ro.socket.in $(top_builddir)/config.status
$(AM_V_GEN)sed \ $(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \ < $< > $@-t && \
mv $@-t $@ mv $@-t $@
libvirtd-admin.socket: remote/libvirtd-admin.socket.in $(top_builddir)/config.status libvirtd-admin.socket: remote/libvirtd-admin.socket.in $(top_builddir)/config.status
$(AM_V_GEN)sed \ $(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \ < $< > $@-t && \
mv $@-t $@ mv $@-t $@
libvirtd-tcp.socket: remote/libvirtd-tcp.socket.in $(top_builddir)/config.status libvirtd-tcp.socket: remote/libvirtd-tcp.socket.in $(top_builddir)/config.status
$(AM_V_GEN)sed \ $(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \ < $< > $@-t && \
mv $@-t $@ mv $@-t $@
libvirtd-tls.socket: remote/libvirtd-tls.socket.in $(top_builddir)/config.status libvirtd-tls.socket: remote/libvirtd-tls.socket.in $(top_builddir)/config.status
$(AM_V_GEN)sed \ $(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \ < $< > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@ -5,7 +5,7 @@ BindsTo=libvirtd.socket
After=libvirtd.socket After=libvirtd.socket
[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 # when using systemd version < 227
ListenStream=@localstatedir@/run/libvirt/libvirt-admin-sock ListenStream=@localstatedir@/run/libvirt/libvirt-admin-sock
Service=libvirtd.service Service=libvirtd.service

View File

@ -5,7 +5,7 @@ BindsTo=libvirtd.socket
After=libvirtd.socket After=libvirtd.socket
[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 # when using systemd version < 227
ListenStream=@localstatedir@/run/libvirt/libvirt-sock-ro ListenStream=@localstatedir@/run/libvirt/libvirt-sock-ro
Service=libvirtd.service Service=libvirtd.service

View File

@ -5,7 +5,7 @@ BindsTo=libvirtd.socket
After=libvirtd.socket After=libvirtd.socket
[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 # when using systemd version < 227
ListenStream=16509 ListenStream=16509
Service=libvirtd.service Service=libvirtd.service

View File

@ -5,7 +5,7 @@ BindsTo=libvirtd.socket
After=libvirtd.socket After=libvirtd.socket
[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 # when using systemd version < 227
ListenStream=16514 ListenStream=16514
Service=libvirtd.service Service=libvirtd.service

View File

@ -1,4 +1,4 @@
(* /etc/libvirt/@DAEMON_NAME@.conf *) (* @sysconfdir@/libvirt/@DAEMON_NAME@.conf *)
module @DAEMON_NAME_UC@ = module @DAEMON_NAME_UC@ =
autoload xfm autoload xfm
@ -114,7 +114,7 @@ module @DAEMON_NAME_UC@ =
let lns = ( record | comment | empty ) * let lns = ( record | comment | empty ) *
let filter = incl "/etc/libvirt/@DAEMON_NAME@.conf" let filter = incl "@sysconfdir@/libvirt/@DAEMON_NAME@.conf"
. Util.stdexcl . Util.stdexcl
let xfm = transform lns filter let xfm = transform lns filter

View File

@ -134,7 +134,7 @@
# the network providing auth (eg, TLS/x509 certificates) # the network providing auth (eg, TLS/x509 certificates)
# #
# - sasl: use SASL infrastructure. The actual auth scheme is then # - 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. # socket only GSSAPI & DIGEST-MD5 mechanisms will be used.
# For non-TCP or TLS sockets, any scheme is allowed. # 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. # 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 # Don't do this outside of a dev/test scenario. For real world
# use, always enable SASL and use the GSSAPI or DIGEST-MD5 # 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" #auth_tcp = "sasl"
# Change the authentication scheme for TLS sockets. # Change the authentication scheme for TLS sockets.
@ -199,10 +199,9 @@
# Use of TLS requires that x509 certificates be issued. The default locations # Use of TLS requires that x509 certificates be issued. The default locations
# for the certificate files is as follows: # for the certificate files is as follows:
# #
# /etc/pki/CA/cacert.pem - The CA master certificate # @sysconfdir@/pki/CA/cacert.pem - The CA master certificate
# /etc/pki/libvirt/servercert.pem - The server certificate signed with # @sysconfdir@/pki/libvirt/servercert.pem - The server certificate signed by cacert.pem
# the cacert.pem # @sysconfdir@/pki/libvirt/private/serverkey.pem - The server private key
# /etc/pki/libvirt/private/serverkey.pem - The server private key
# #
# It is possible to override the default locations by altering the 'key_file', # It is possible to override the default locations by altering the 'key_file',
# 'cert_file', and 'ca_file' values and uncommenting them below. # 'cert_file', and 'ca_file' values and uncommenting them below.
@ -213,20 +212,20 @@
# Override the default server key file path # 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 # 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 # 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. # Specify a certificate revocation list.
# #
# Defaults to not using a CRL, uncomment to enable it # Defaults to not using a CRL, uncomment to enable it
#crl_file = "/etc/pki/CA/crl.pem" #crl_file = "@sysconfdir@/pki/CA/crl.pem"

View File

@ -22,7 +22,7 @@ Documentation=https://libvirt.org
[Service] [Service]
Type=notify Type=notify
EnvironmentFile=-/etc/sysconfig/libvirtd EnvironmentFile=-@sysconfdir@/sysconfig/libvirtd
# libvirtd.service is set to run on boot so that autostart of # 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 # VMs can be performed. We don't want it to stick around if
# unused though, so we set a timeout. The socket activation # unused though, so we set a timeout. The socket activation

View File

@ -3,7 +3,7 @@ Description=Libvirt local socket
Before=libvirtd.service Before=libvirtd.service
[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 # when using systemd version < 227
ListenStream=@localstatedir@/run/libvirt/libvirt-sock ListenStream=@localstatedir@/run/libvirt/libvirt-sock
Service=libvirtd.service Service=libvirtd.service

View File

@ -24,10 +24,10 @@ module Test_@DAEMON_NAME@ =
{ "1" = "polkit" } { "1" = "polkit" }
} }
@CUT_ENABLE_IP@ @CUT_ENABLE_IP@
{ "key_file" = "/etc/pki/libvirt/private/serverkey.pem" } { "key_file" = "@sysconfdir@/pki/libvirt/private/serverkey.pem" }
{ "cert_file" = "/etc/pki/libvirt/servercert.pem" } { "cert_file" = "@sysconfdir@/pki/libvirt/servercert.pem" }
{ "ca_file" = "/etc/pki/CA/cacert.pem" } { "ca_file" = "@sysconfdir@/pki/CA/cacert.pem" }
{ "crl_file" = "/etc/pki/CA/crl.pem" } { "crl_file" = "@sysconfdir@/pki/CA/crl.pem" }
{ "tls_no_sanity_certificate" = "1" } { "tls_no_sanity_certificate" = "1" }
{ "tls_no_verify_certificate" = "1" } { "tls_no_verify_certificate" = "1" }
{ "tls_allowed_dn_list" { "tls_allowed_dn_list"

View File

@ -10,7 +10,7 @@ Documentation=man:libvirtd(8)
Documentation=https://libvirt.org Documentation=https://libvirt.org
[Service] [Service]
EnvironmentFile=-/etc/sysconfig/libvirt-guests EnvironmentFile=-@sysconfdir@/sysconfig/libvirt-guests
# Hack just call traditional service until we factor # Hack just call traditional service until we factor
# out the code # out the code
ExecStart=@libexecdir@/libvirt-guests.sh start ExecStart=@libexecdir@/libvirt-guests.sh start