[libvirt] [PATCH] Configuring systemd to restart libvirt on abort

From: Mooli Tayer <mtayer@redhat.com> This will create a respawn behaviour in case libvirt process exits due to an uncaught signal not specified as a clean exit status. see http://www.freedesktop.org/software/systemd/man/systemd.service.html --- daemon/libvirtd.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in index aa5913b..b3c0849 100644 --- a/daemon/libvirtd.service.in +++ b/daemon/libvirtd.service.in @@ -15,6 +15,7 @@ EnvironmentFile=-/etc/sysconfig/libvirtd ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS ExecReload=/bin/kill -HUP $MAINPID KillMode=process +Restart=on-abort # Override the maximum number of opened files #LimitNOFILE=2048 -- 1.8.3.1

On 07/29/2013 08:36 AM, Mooli Tayer wrote:
From: Mooli Tayer <mtayer@redhat.com>
This will create a respawn behaviour in case libvirt process exits due to an uncaught signal not specified as a clean exit status. see http://www.freedesktop.org/software/systemd/man/systemd.service.html --- daemon/libvirtd.service.in | 1 + 1 file changed, 1 insertion(+)
Looks useful. However, I think this is a feature, and as we are already in freeze for 1.1.1, I think this should wait until after the release before this goes in.
diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in index aa5913b..b3c0849 100644 --- a/daemon/libvirtd.service.in +++ b/daemon/libvirtd.service.in @@ -15,6 +15,7 @@ EnvironmentFile=-/etc/sysconfig/libvirtd ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS ExecReload=/bin/kill -HUP $MAINPID KillMode=process +Restart=on-abort # Override the maximum number of opened files #LimitNOFILE=2048
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

----- Original Message -----
On 07/29/2013 08:36 AM, Mooli Tayer wrote:
From: Mooli Tayer <mtayer@redhat.com>
This will create a respawn behaviour in case libvirt process exits due to an uncaught signal not specified as a clean exit status. see http://www.freedesktop.org/software/systemd/man/systemd.service.html --- daemon/libvirtd.service.in | 1 + 1 file changed, 1 insertion(+)
Looks useful. However, I think this is a feature, and as we are already in freeze for 1.1.1, I think this should wait until after the release before this goes in.
Does this patch needs to be resubmitted after the release?
diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in index aa5913b..b3c0849 100644 --- a/daemon/libvirtd.service.in +++ b/daemon/libvirtd.service.in @@ -15,6 +15,7 @@ EnvironmentFile=-/etc/sysconfig/libvirtd ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS ExecReload=/bin/kill -HUP $MAINPID KillMode=process +Restart=on-abort # Override the maximum number of opened files #LimitNOFILE=2048
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Mon, Jul 29, 2013 at 05:36:21PM +0300, Mooli Tayer wrote:
From: Mooli Tayer <mtayer@redhat.com>
This will create a respawn behaviour in case libvirt process exits due to an uncaught signal not specified as a clean exit status. see http://www.freedesktop.org/software/systemd/man/systemd.service.html --- daemon/libvirtd.service.in | 1 + 1 file changed, 1 insertion(+)
diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in index aa5913b..b3c0849 100644 --- a/daemon/libvirtd.service.in +++ b/daemon/libvirtd.service.in @@ -15,6 +15,7 @@ EnvironmentFile=-/etc/sysconfig/libvirtd ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS ExecReload=/bin/kill -HUP $MAINPID KillMode=process +Restart=on-abort # Override the maximum number of opened files #LimitNOFILE=2048
I'm wondering whether 'on-abort' is the best choice or if 'on-failure' or 'always' are better. The systemd.service man page says [quote] Takes one of no, on-success, on-failure, on-abort, or always. If set to no (the default) the service will not be restarted. If set to on-success it will be restarted only when the service process exits cleanly. In this context, a clean exit means an exit code of 0, or one of the signals SIGHUP, SIGINT, SIGTERM, or SIGPIPE, and additionally, exit statuses and signals specified in SuccessExitStatus=. If set to on-failure the service will be restarted when the process exits with an nonzero exit code, is terminated by a signal (including on core dump), when an operation (such as service reload) times out, and when the configured watchdog timeout is triggered. If set to on-abort the service will be restarted only if the service process exits due to an uncaught signal not specified as a clean exit status. If set to always the service will be restarted regardless whether it exited cleanly or not, got terminated abnormally by a signal or hit a timeout. [/quote] I tend towards saying 'on-failure' here. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

This will create a respawn behaviour in case libvirt process exits due to nonzero exit code, is terminated by a signal, an operation times out or the configured watchdog timeout is triggered. see http://www.freedesktop.org/software/systemd/man/systemd.service.html --- daemon/libvirtd.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in index aa5913b..25979ef 100644 --- a/daemon/libvirtd.service.in +++ b/daemon/libvirtd.service.in @@ -15,6 +15,7 @@ EnvironmentFile=-/etc/sysconfig/libvirtd ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS ExecReload=/bin/kill -HUP $MAINPID KillMode=process +Restart=on-failure # Override the maximum number of opened files #LimitNOFILE=2048 -- 1.8.3.1

On Tue, Jul 30, 2013 at 03:32:59PM +0300, Mooli Tayer wrote:
This will create a respawn behaviour in case libvirt process exits due to nonzero exit code, is terminated by a signal, an operation times out or the configured watchdog timeout is triggered. see http://www.freedesktop.org/software/systemd/man/systemd.service.html --- daemon/libvirtd.service.in | 1 + 1 file changed, 1 insertion(+)
diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in index aa5913b..25979ef 100644 --- a/daemon/libvirtd.service.in +++ b/daemon/libvirtd.service.in @@ -15,6 +15,7 @@ EnvironmentFile=-/etc/sysconfig/libvirtd ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS ExecReload=/bin/kill -HUP $MAINPID KillMode=process +Restart=on-failure # Override the maximum number of opened files #LimitNOFILE=2048
FWIW, ack by me.

On 07/31/2013 06:13 AM, Dan Kenigsberg wrote:
On Tue, Jul 30, 2013 at 03:32:59PM +0300, Mooli Tayer wrote:
This will create a respawn behaviour in case libvirt process exits due to nonzero exit code, is terminated by a signal, an operation times out or the configured watchdog timeout is triggered. see http://www.freedesktop.org/software/systemd/man/systemd.service.html --- daemon/libvirtd.service.in | 1 + 1 file changed, 1 insertion(+)
diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in index aa5913b..25979ef 100644 --- a/daemon/libvirtd.service.in +++ b/daemon/libvirtd.service.in @@ -15,6 +15,7 @@ EnvironmentFile=-/etc/sysconfig/libvirtd ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS ExecReload=/bin/kill -HUP $MAINPID KillMode=process +Restart=on-failure # Override the maximum number of opened files #LimitNOFILE=2048
FWIW, ack by me.
Likewise. I've pushed this now; and we have a full release cycle to test it for those using libvirt.git. I tweaked the commit message to mention https://bugzilla.redhat.com/show_bug.cgi?id=981974 -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (5)
-
Dan Kenigsberg
-
Daniel P. Berrange
-
Eric Blake
-
Mooli Tayer
-
Mooli Tayer