Skip to content
Snippets Groups Projects
Commit 5ae74e05 authored by Andrea Bolognani's avatar Andrea Bolognani
Browse files

libvirtd: Improve default file

Several changes:

  * use $LIBVIRTD_ARGS, which is consistent with upstream and
    other daemons, instead of $libvirtd_opts;

  * drop mentions of $KRB5_KTNAME, same as upstream has done
    with commit 68d08cf2f200;

  * list all sysv-only options together, and make it very clear
    that they don't apply when systemd is in use.

Note that, unlike upstream, we don't enable a timeout for
libvirtd by default: this is because we need the default file
to work both for systemd, which has socket activation, and for
sysv, which doesn't.

During upgrades, if the default file had not been modified by
the user then the transition will happen quietly; however, if
local modifications had been made, then the admin will be left
dealing with a nasty-looking diff: highlighting the change in
a NEWS entry will hopefully mitigate the confusion.
parent 7237af0c
No related branches found
No related tags found
1 merge request!101Improvements around default files and init scripts
......@@ -151,7 +151,7 @@ case "$1" in
fi
fi
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- -d $libvirtd_opts
--exec $DAEMON -- -d $LIBVIRTD_ARGS
if running; then
log_end_msg 0
else
......@@ -189,7 +189,7 @@ case "$1" in
/var/run/$NAME.pid --exec $DAEMON
[ -n "$DODTIME" ] && sleep $DODTIME
start-stop-daemon --start --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON -- -d $libvirtd_opts
/var/run/$NAME.pid --exec $DAEMON -- -d $LIBVIRTD_ARGS
if running; then
log_end_msg 0
else
......
libvirt (7.0.0-3) unstable; urgency=medium
The $libvirtd_opts variable in /etc/default/libvirtd has been
renamed to $LIBVIRTD_ARGS to match upstream and other daemons
that are part of libvirt.
Other changes have been made to the file as well, so it's
recommended to pay extra attention if prompted by dpkg about
it during an upgrade.
-- Andrea Bolognani <eof@kiyuko.org> Mon, 15 Feb 2021 00:45:40 +0100
libvirt (6.9.0-4) unstable; urgency=medium
The configuration for the default network and the default set
......
......@@ -3,17 +3,15 @@ Date: Sun, 14 Feb 2021 18:10:53 +0100
Subject: Debianize libvirtd
---
src/remote/libvirtd.sysconf | 34 ++++++++++++++++------------------
1 file changed, 16 insertions(+), 18 deletions(-)
src/remote/libvirtd.sysconf | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/src/remote/libvirtd.sysconf b/src/remote/libvirtd.sysconf
index 18aec1b..142044c 100644
index 18aec1b..9c5d18b 100644
--- a/src/remote/libvirtd.sysconf
+++ b/src/remote/libvirtd.sysconf
@@ -1,21 +1,19 @@
-# Customizations for the libvirtd.service systemd unit
+# Defaults for libvirtd initscript (/etc/init.d/libvirtd)
+# This is a POSIX shell fragment
@@ -1,11 +1,14 @@
# Customizations for the libvirtd.service systemd unit
-# Default behaviour is for libvirtd.service to start on boot
-# so that VM autostart can be performed. We then want it to
......@@ -21,30 +19,32 @@ index 18aec1b..142044c 100644
-# socket activation to start it again when some client app
-# connects.
-LIBVIRTD_ARGS="--timeout 120"
+LIBVIRTD_ARGS=""
+
+# The default upstream behavior is for libvirtd.service to
+# start on boot, perform VM autostart and shutdown again if
+# nothing was started; later on, systemd socket activation
+# is used to start it again when some client app connects.
+#
+# The following can be used to enable this behavior
+#LIBVIRTD_ARGS="--timeout 120"
# If systemd socket activation is disabled, then the following
# can be used to listen on TCP/TLS sockets
@@ -19,3 +22,16 @@ LIBVIRTD_ARGS="--timeout 120"
#QEMU_AUDIO_DRV=sdl
#
#SDL_AUDIODRIVER=pulse
+
+#############################################################
+### The following settings are IGNORED when using systemd ###
+#############################################################
+
+# Start libvirtd to handle qemu/kvm:
+start_libvirtd="yes"
-# If systemd socket activation is disabled, then the following
-# can be used to listen on TCP/TLS sockets
-#LIBVIRTD_ARGS="--listen"
+# options passed to libvirtd, see man libvirtd for details.
+# For example to enable listening on tcp add -l here
+# and set up the TLS Certificates that libvirtd will need.
+#libvirtd_opts=""
-# Override the QEMU/SDL default audio driver probing when
-# starting virtual machines using SDL graphics
-#
-# NB these have no effect for VMs using VNC, unless vnc_allow_host_audio
-# is enabled in /etc/libvirt/qemu.conf
-#QEMU_AUDIO_DRV=sdl
-#
-#SDL_AUDIODRIVER=pulse
+# pass in location of kerberos keytab
+#export KRB5_KTNAME=/etc/libvirt/libvirt.keytab
+
+# Whether to mount a systemd like cgroup layout (only
+# useful when not running systemd)
+# Whether to mount a systemd like cgroup layout
+#mount_cgroups=yes
+
+# Which cgroups to mount
+#cgroups="memory devices"
......@@ -5,9 +5,9 @@ Subject: Debianize systemd service files
---
src/locking/virtlockd.service.in | 2 +-
src/logging/virtlogd.service.in | 2 +-
src/remote/libvirtd.service.in | 4 ++--
src/remote/libvirtd.service.in | 2 +-
tools/libvirt-guests.service.in | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/locking/virtlockd.service.in b/src/locking/virtlockd.service.in
index 4a6fab0..12aebde 100644
......@@ -36,20 +36,18 @@ index 8ab5478..dd25c7c 100644
ExecReload=/bin/kill -USR1 $MAINPID
# Losing the logs is a really bad thing that will
diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in
index cc0d4e3..dd38500 100644
index cc0d4e3..300610e 100644
--- a/src/remote/libvirtd.service.in
+++ b/src/remote/libvirtd.service.in
@@ -28,8 +28,8 @@ Documentation=https://libvirt.org
@@ -28,7 +28,7 @@ Documentation=https://libvirt.org
[Service]
Type=notify
-EnvironmentFile=-@sysconfdir@/sysconfig/libvirtd
-ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
+EnvironmentFile=-@sysconfdir@/default/libvirtd
+ExecStart=@sbindir@/libvirtd $libvirtd_opts
ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
diff --git a/tools/libvirt-guests.service.in b/tools/libvirt-guests.service.in
index 10c6640..e858be5 100644
--- a/tools/libvirt-guests.service.in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment