]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
remote: notify systemd when reloading config
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 7 Jan 2025 15:29:20 +0000 (15:29 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 12 Feb 2025 18:05:38 +0000 (18:05 +0000)
Switch to the 'notify-reload' service type and send notifications to
systemd when reloading configuration.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/remote/libvirtd.service.in
src/remote/remote_daemon.c
src/virtd.service.in

index 250b4a6fc36b00d50598b8a88bc07d28734b3fd0..b0a062e8858bd99d38e91e426a9fa093d11632d4 100644 (file)
@@ -26,7 +26,7 @@ After=xencommons.service
 Conflicts=xendomains.service
 
 [Service]
-Type=notify
+Type=notify-reload
 Environment=LIBVIRTD_ARGS="--timeout 120"
 EnvironmentFile=-@initconfdir@/libvirtd
 ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
index 1d079c7e4b2644e6c8307af4b0bacbba2c7ab0dc..d44a36500080ebae4049013a6c0347eb1988a002 100644 (file)
@@ -452,9 +452,11 @@ static void daemonReloadHandlerThread(void *opaque G_GNUC_UNUSED)
     virHookCall(VIR_HOOK_DRIVER_DAEMON, "-",
                 VIR_HOOK_DAEMON_OP_RELOAD, SIGHUP, "SIGHUP", NULL, NULL);
 
+    virSystemdNotifyReload();
     if (virStateReload() < 0) {
         VIR_WARN("Error while reloading drivers");
     }
+    virSystemdNotifyReady();
 
     /* Drivers are initialized again. */
     g_atomic_int_set(&driversInitialized, 1);
index 651a8d82d7d3c0f690d2413e789830f32dbd1068..7ffb77e339f6c8d2201e3823fa4a28505746c1c1 100644 (file)
@@ -15,7 +15,7 @@ After=dbus.service
 After=apparmor.service
 
 [Service]
-Type=notify
+Type=notify-reload
 Environment=@SERVICE@_ARGS="--timeout 120"
 EnvironmentFile=-@initconfdir@/@service@
 ExecStart=@sbindir@/@service@ $@SERVICE@_ARGS