[libvirt PATCH 4/8] logging, locking: Set default timeout of 120 seconds

Daniel P. Berrangé berrange at redhat.com
Thu Apr 2 12:10:27 UTC 2020


On Wed, Apr 01, 2020 at 08:53:41PM +0200, Andrea Bolognani wrote:
> This is consistent with what is already done for all other
> daemons.
> 
> Signed-off-by: Andrea Bolognani <abologna at redhat.com>
> ---
>  src/locking/virtlockd.service.in | 2 +-
>  src/logging/virtlogd.service.in  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/locking/virtlockd.service.in b/src/locking/virtlockd.service.in
> index e7f8057c06..dc43f771cd 100644
> --- a/src/locking/virtlockd.service.in
> +++ b/src/locking/virtlockd.service.in
> @@ -8,7 +8,7 @@ Documentation=https://libvirt.org
>  
>  [Service]
>  EnvironmentFile=- at sysconfdir@/sysconfig/virtlockd
> -ExecStart=@sbindir@/virtlockd $VIRTLOCKD_ARGS
> +ExecStart=@sbindir@/virtlockd --timeout 120 $VIRTLOCKD_ARGS
>  ExecReload=/bin/kill -USR1 $MAINPID
>  # Loosing the locks is a really bad thing that will
>  # cause the machine to be fenced (rebooted), so make

I think this is safe, because IIRC we intentionally leak the RPC
connection FD to QEMU and thus will keep it open & inhibiti shutdown.

> diff --git a/src/logging/virtlogd.service.in b/src/logging/virtlogd.service.in
> index daff48e67d..7ad9545581 100644
> --- a/src/logging/virtlogd.service.in
> +++ b/src/logging/virtlogd.service.in
> @@ -8,7 +8,7 @@ Documentation=https://libvirt.org
>  
>  [Service]
>  EnvironmentFile=- at sysconfdir@/sysconfig/virtlogd
> -ExecStart=@sbindir@/virtlogd $VIRTLOGD_ARGS
> +ExecStart=@sbindir@/virtlogd --timeout 120 $VIRTLOGD_ARGS
>  ExecReload=/bin/kill -USR1 $MAINPID
>  # Loosing the logs is a really bad thing that will
>  # cause the machine to be fenced (rebooted), so make

I'm fairly sure this is not safe on its own.

virLogDaemonInhibitor only inhibits timer shutdown for the unprivileged
daemon. This setting a timeout will cause the virtlogd to shutdown even
when log files are open. I can't remember why I special cased this in
the code now, but fairly sure we'll need to fix that first.


Can you test to ensure that they don't prematurely shut down when logs
or locks are held.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list