mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
remote: notify systemd when reloading config
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>
This commit is contained in:
parent
785cd56e58
commit
8a6088221a
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user