Skip to contentSkip to conversation

libvirt: Fix keeping restarting

PATCH In review He Zhe 2 participants 2 messages May 17, 2022 – May 18, 2022

lore
Share & tools
lore

He Zhe

author
#0 lore raw

PATCH 1/1 libvirt: Fix keeping restarting

LIBVIRTD_ARGS has been moved to libvirtd.service since v8.1.0. Move our mode setting accordingly, otherwise libvirt would keep restarting and VMs would be constantly stopped.

---
 recipes-extended/libvirt/libvirt_8.1.0.bb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
recipes-extended/libvirt/libvirt_8.1.0.bb +2 -3
index f8deba45..89f82bf8 100644
@@ -208,12 +208,11 @@ do_install:append() {
                 rmdir ${D}${prefix}/lib/systemd/system ${D}${prefix}/lib/systemd
             fi
 
-	    # This variable is used by libvirtd.service to start libvirtd in the right mode
-	    sed -i '/#LIBVIRTD_ARGS="--listen"/a LIBVIRTD_ARGS="--listen --daemon"' ${D}/${sysconfdir}/init.d/libvirtd
-
 	    # We can't use 'notify' when we don't support 'sd_notify' dbus capabilities.
+	    # Change default LIBVIRTD_ARGS to start libvirtd in the right mode.
 	    sed -i -e 's/Type=notify/Type=forking/' \
 	           -e '/Type=forking/a PIDFile=/run/libvirtd.pid' \
+	           -e 's/\(Environment=LIBVIRTD_ARGS="--timeout 120"\)/#\1\nEnvironment=LIBVIRTD_ARGS="--listen --daemon"/' \
 		   ${D}/${systemd_system_unitdir}/libvirtd.service
 	fi
 
Signature · 1 line
2.25.1
#1 lore raw

merged

Bruce

Quoted 32 lines · He Zhe

LIBVIRTD_ARGS has been moved to libvirtd.service since v8.1.0. Move our mode setting accordingly, otherwise libvirt would keep restarting and VMs would be constantly stopped.

---
 recipes-extended/libvirt/libvirt_8.1.0.bb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
recipes-extended/libvirt/libvirt_8.1.0.bb +2 -4
index f8deba45..89f82bf8 100644
@@ -208,12 +208,11 @@ do_install:append() {
                 rmdir ${D}${prefix}/lib/systemd/system ${D}${prefix}/lib/systemd
             fi
 
-           # This variable is used by libvirtd.service to start libvirtd in the right mode
-           sed -i '/#LIBVIRTD_ARGS="--listen"/a LIBVIRTD_ARGS="--listen --daemon"' ${D}/${sysconfdir}/init.d/libvirtd
-
            # We can't use 'notify' when we don't support 'sd_notify' dbus capabilities.
+           # Change default LIBVIRTD_ARGS to start libvirtd in the right mode.
            sed -i -e 's/Type=notify/Type=forking/' \
                   -e '/Type=forking/a PIDFile=/run/libvirtd.pid' \
+                  -e 's/\(Environment=LIBVIRTD_ARGS="--timeout 120"\)/#\1\nEnvironment=LIBVIRTD_ARGS="--listen --daemon"/' \
                   ${D}/${systemd_system_unitdir}/libvirtd.service
        fi
 
--

2.25.1

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II