Devuan bug report logs - #633
qemu-guest-agent: Guest agent does not shut down the guest when requested to

version graph

Package: sysvinit; Maintainer for sysvinit is Devuan Developers <devuan-dev@lists.dyne.org>; Source for sysvinit is src:sysvinit.

Reported by: Fabio Muzzi <debianbugs@kurgan.org>

Date: Sat, 20 Nov 2021 19:12:01 UTC

Severity: grave

Tags: chimaera

Found in version 2.96-7+devuan1

Fixed in versions 3.00-1+devuan1, 2.96-7+devuan2

Done: dak@devuan.org

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to devuan-bugs@lists.dyne.org, debianbugs@kurgan.org, devuan-dev@lists.dyne.org:
bug#633; Package qemu-guest-agent. (Sat, 20 Nov 2021 19:12:01 GMT) (full text, mbox, link).


Acknowledgement sent to Fabio Muzzi <debianbugs@kurgan.org>:
New bug report received and forwarded. Copy sent to debianbugs@kurgan.org, devuan-dev@lists.dyne.org. (Sat, 20 Nov 2021 19:12:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.devuan.org (full text, mbox, reply):

From: Fabio Muzzi <debianbugs@kurgan.org>
To: Devuan Bug Tracking System <submit@bugs.devuan.org>
Subject: qemu-guest-agent: Guest agent does not shut down the guest when requested to
Date: Sat, 20 Nov 2021 20:06:15 +0100
Package: qemu-guest-agent
Version: 1:5.2+dfsg-11+deb11u1
Severity: grave
Justification: renders package unusable
X-Debbugs-Cc: debianbugs@kurgan.org

Dear Maintainer,

I have installed a Devuan 4 guest in a PVE 7.1 host, with Quemu guest
enabled in PVE and the guest agent package installed in the guest.

When commanding a guest shutdown from the host, a shutdown command is
sent to the guest agent (because the host knows the guest has the agent
installed, otherwise it would use an ACPI command to "press the power
button").

The guest gets the command, and writes in the syslog the following line:

Nov 20 18:50:09 fileserver qemu-ga: info: guest-shutdown called, mode:
(null)

Then a shutdown should be initiated, but nothing happens. The guest
keeps running.

I can send multiple shutdown commands from the host, they are all
received by the guest, but nothing happens, they just get logged in the
syslog.

I would expect the guest agent to start a shutdown.


Tried installing a Debian 11 virtual on the same PVE host, and the
shutdown command works as expected, logging the same line and then
immediately commanding a shutdown.


I suppose that this version of qemu-ga requires systemd to actually command a shutdown? 

Qemu-ga is version 5.2.0

It worked in Devuan 3.


Kind regards


-- System Information:
Distributor ID:	Devuan
Description:	Devuan GNU/Linux 4 (chimaera)
Release:	4
Codename:	chimaera
Architecture: x86_64

Kernel: Linux 5.10.0-9-amd64 (SMP w/2 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages qemu-guest-agent depends on:
ii  init-system-helpers   1.60+devuan1
ii  libc6                 2.31-13+deb11u2
ii  libeudev1 [libudev1]  3.2.9-10~chimaera1
ii  libglib2.0-0          2.66.8-1
ii  liburing1             0.7-3
ii  lsb-base              11.1.0

qemu-guest-agent recommends no packages.

qemu-guest-agent suggests no packages.

-- no debconf information

Information forwarded to devuan-bugs@lists.dyne.org, devuan-dev@lists.dyne.org:
bug#633; Package qemu-guest-agent. (Sat, 20 Nov 2021 21:42:01 GMT) (full text, mbox, link).


Acknowledgement sent to Fabio Muzzi <debianbugs@kurgan.org>:
Extra info received and forwarded to list. Copy sent to devuan-dev@lists.dyne.org. (Sat, 20 Nov 2021 21:42:04 GMT) (full text, mbox, link).


Message #10 received at 633@bugs.devuan.org (full text, mbox, reply):

From: Fabio Muzzi <debianbugs@kurgan.org>
To: 633@bugs.devuan.org
Subject: Adding a debug session...
Date: Sat, 20 Nov 2021 22:30:21 +0100
I have tried adding debug to qemu-ga by running it with "-v"


This is the output (quite useless):

....

1637443549.171361: debug: received EOF
1637443549.271676: debug: received EOF
1637443549.371984: debug: received EOF
1637443549.472366: debug: received EOF
1637443549.572709: debug: received EOF
1637443549.672992: debug: received EOF
1637443549.773299: debug: received EOF
1637443549.873531: debug: received EOF
1637443549.973770: debug: received EOF
1637443550.74010: debug: received EOF
1637443550.174254: debug: received EOF
1637443550.274485: debug: received EOF
1637443550.374718: debug: received EOF
1637443550.474979: debug: read data, count: 107, data: {"execute":"guest-sync-delimited","arguments":{"id":14277701}}
{"execute":"guest-shutdown","arguments":{}}

1637443550.475015: debug: process_event: called
1637443550.475017: debug: processing command
1637443550.475033: debug: sending data, count: 22
1637443550.475064: debug: process_event: called
1637443550.475065: debug: processing command
1637443550.475949: debug: sending data, count: 85
1637443550.476270: debug: received EOF
1637443550.576487: debug: received EOF
1637443550.676752: debug: received EOF
1637443550.776995: debug: received EOF
1637443550.877230: debug: received EOF
1637443550.977466: debug: received EOF
1637443551.77712: debug: received EOF
1637443551.177949: debug: received EOF
1637443551.278182: debug: received EOF
1637443551.378414: debug: received EOF
1637443551.478652: debug: received EOF
1637443551.578900: debug: received EOF
1637443551.679143: debug: received EOF
1637443551.779237: debug: received EOF

....


-- 
Fabio "Kurgan" Muzzi

- IZ4UFQ -

"Il massimo danno con il minimo sforzo"


Information forwarded to devuan-bugs@lists.dyne.org, devuan-dev@lists.dyne.org:
bug#633; Package qemu-guest-agent. (Sat, 20 Nov 2021 23:02:02 GMT) (full text, mbox, link).


Acknowledgement sent to Fabio Muzzi <debianbugs@kurgan.org>:
Extra info received and forwarded to list. Copy sent to devuan-dev@lists.dyne.org. (Sat, 20 Nov 2021 23:02:04 GMT) (full text, mbox, link).


Message #15 received at 633@bugs.devuan.org (full text, mbox, reply):

From: Fabio Muzzi <debianbugs@kurgan.org>
To: 633@bugs.devuan.org
Subject: gdb trace - and a workaround
Date: Sat, 20 Nov 2021 23:54:29 +0100
I have gone further and run gdb.

It seems that the agent actually tries to call /sbin/shutdown with the following parameters:

"-h -P +0 hypervisor initiated shutdown"


But if I run shutdown manually with  these parameters, I get an error and the help message shows up:



root@fileserver:/sbin# /sbin/shutdown -h -P +0 hypervisor initiated shutdown
Usage:    shutdown [-akrhPHfFnc] [-t sec] time [warning message]
                  -a:      use /etc/shutdown.allow
                  -k:      don't really shutdown, only warn.
                  -r:      reboot after shutdown.
                  -h:      halt after shutdown.
                  -P:      halt action is to turn off power.
                           can only be used along with -h flag.
                  -H:      halt action is to just halt.
                           can only be used along with -h flag.
                  -f:      do a 'fast' reboot (skip fsck).
                  -F:      Force fsck on reboot.
                  -n:      do not go through "init" but go down real fast.
                  -c:      cancel a running shutdown.
                  -q:      quiet mode - display fewer shutdown warnings.
                  -Q:      full quiet mode - display only final shutdown warning.
                  -t secs: delay between warning and kill signal.
                  ** the "time" argument is mandatory! (try "now") **



So it seems that /sbin/shutdown does not like the command line that qemu-agent uses.

It seems that the Devuan shutdown command wants a mandatory "time", so for example

shutdown -h -P now

works.

But the qemu agent uses a syntax that is wrong for the Devuan shutdown binary, while it works fine for the systemd-infested shutdown that is just a link to systemcl (in Debian 11).


A workaroung is to rename /sbin/shutdown and create a script that calls shutdown with a command line that it accepts, like:


/sbin/shutdown -h -P now hypervisor initiated shutdown

Notice the "now" instead of the "+0" in the arguments.


-- 
Fabio "Kurgan" Muzzi

- IZ4UFQ -

"Il massimo danno con il minimo sforzo"


Information forwarded to devuan-bugs@lists.dyne.org, devuan-dev@lists.dyne.org:
bug#633; Package qemu-guest-agent. (Sun, 21 Nov 2021 09:32:01 GMT) (full text, mbox, link).


Message #18 received at 633@bugs.devuan.org (full text, mbox, reply):

From: Mark Hindley <mark@hindley.org.uk>
To: Fabio Muzzi <debianbugs@kurgan.org>, 633@bugs.devuan.org
Subject: Re: bug#633: gdb trace - and a workaround
Date: Sun, 21 Nov 2021 09:27:57 +0000
Control: tags -1 debian

Fabio,

Thanks for this and debugging what is going on.

On Sat, Nov 20, 2021 at 11:54:29PM +0100, Fabio Muzzi wrote:
> 
> I have gone further and run gdb.
> 
> It seems that the agent actually tries to call /sbin/shutdown with the following parameters:
> 
> "-h -P +0 hypervisor initiated shutdown"

To me, this is a bug in qemu-agent which is assuming the guest is running
systemd.

qemu-agent is not a forked package and Devuan uses Debian's packages directly
without recompilation. So, in principle, this is an issue that needs reporting
to Debian's BTS to be fixed there. However, if there is a configuration option
to change the shutdown command sent, we might be able to override that in
Devuan.  I don't use the package myself, so it would be helpful if you could
investigate that?

Thanks

Mark

Added tag(s) debian. Request was from Mark Hindley <mark@hindley.org.uk> to 633-submit@bugs.devuan.org. (Sun, 21 Nov 2021 09:32:03 GMT) (full text, mbox, link).


Information forwarded to devuan-bugs@lists.dyne.org, devuan-dev@lists.dyne.org:
bug#633; Package qemu-guest-agent. (Sun, 21 Nov 2021 12:42:02 GMT) (full text, mbox, link).


Message #23 received at 633@bugs.devuan.org (full text, mbox, reply):

From: Mark Hindley <mark@hindley.org.uk>
To: Fabio Muzzi <debianbugs@kurgan.org>, 633@bugs.devuan.org
Subject: Re: bug#633: Actually sysvinit /sbin/shutdown's fault
Date: Sun, 21 Nov 2021 12:32:51 +0000
Control: reassign -1 src:sysvinit
Control: found -1 2.96-7+devuan1
Control: notfount -1 3.00-1+devuan1
Control: tags -1 =chimaera

Fabio,

On Sun, Nov 21, 2021 at 09:27:58AM +0000, Mark Hindley wrote:
> > "-h -P +0 hypervisor initiated shutdown"

As rrq just pointed out on #devuan-infra, this is actually a bug in sysvinit
/sbin/shutdown not parsing the +0 argument.

This was fixed upstream in version 2.98:

sysvinit (2.98) released; urgency=low

    * Fixed time parsing in shutdown when there is a + in front of a 0 time offset.
      Commands with a positive time offset (+1) would work but +0 fails.
      This has been corrected by Arkadiusz Miskiewicz.

Reassigning and setting versions.

I will investigate backporting to chimaera.

Thanks.

Mark

bug reassigned from package 'qemu-guest-agent' to 'src:sysvinit'. Request was from Mark Hindley <mark@hindley.org.uk> to 633-submit@bugs.devuan.org. (Sun, 21 Nov 2021 12:42:05 GMT) (full text, mbox, link).


No longer marked as found in versions 1:5.2+dfsg-11+deb11u1. Request was from Mark Hindley <mark@hindley.org.uk> to 633-submit@bugs.devuan.org. (Sun, 21 Nov 2021 12:42:05 GMT) (full text, mbox, link).


Added tag(s) chimaera; removed tag(s) debian. Request was from Mark Hindley <mark@hindley.org.uk> to 633-submit@bugs.devuan.org. (Sun, 21 Nov 2021 12:42:05 GMT) (full text, mbox, link).


Information forwarded to devuan-bugs@lists.dyne.org, Vincenzo (KatolaZ) Nicosia <katolaz@freaknet.org>:
bug#633; Package src:sysvinit. (Sun, 21 Nov 2021 12:56:01 GMT) (full text, mbox, link).


Information forwarded to devuan-bugs@lists.dyne.org, Vincenzo (KatolaZ) Nicosia <katolaz@freaknet.org>:
bug#633; Package src:sysvinit. (Sun, 21 Nov 2021 12:56:06 GMT) (full text, mbox, link).


Message #35 received at 633@bugs.devuan.org (full text, mbox, reply):

From: Mark Hindley <mark@hindley.org.uk>
To: 633@bugs.devuan.org, Fabio Muzzi <debianbugs@kurgan.org>
Subject: Re: bug#633: Actually sysvinit /sbin/shutdown's fault
Date: Sun, 21 Nov 2021 12:48:57 +0000
Control: found -1 2.96-7+devuan1
Control: notfound -1 3.00-1+devuan1

Fabio,

On Sun, Nov 21, 2021 at 12:32:51PM +0000, Mark Hindley wrote:
> I will investigate backporting to chimaera.

I have just added src:sysvinit 3.00-1+devuan1 to chimaera-backports.

Can you try that version, please?

Thanks.

Mark

Information forwarded to devuan-bugs@lists.dyne.org, Vincenzo (KatolaZ) Nicosia <katolaz@freaknet.org>:
bug#633; Package src:sysvinit. (Sun, 21 Nov 2021 14:08:16 GMT) (full text, mbox, link).


Acknowledgement sent to Fabio Muzzi <debianbugs@kurgan.org>:
Extra info received and forwarded to list. Copy sent to Vincenzo (KatolaZ) Nicosia <katolaz@freaknet.org>. (Sun, 21 Nov 2021 14:08:18 GMT) (full text, mbox, link).


Message #40 received at 633@bugs.devuan.org (full text, mbox, reply):

From: Fabio Muzzi <debianbugs@kurgan.org>
To: 633@bugs.devuan.org
Subject: sysvinit-core from backports works - FIXED
Date: Sun, 21 Nov 2021 15:00:38 +0100
Thank you very much.

I have enabled backports and installed sysvinit AND SYSVINIT-CORE TOO (otherwise it does not install the actual shutdown binary) from backports, like this:


apt -t chimaera-backports install sysvinit-core sysvinit


And now it works as it should.

Answering to another comment from you, there is no way to fix the agent by configuring it, its shutdown commands are hardcoded.

-- 
Fabio "Kurgan" Muzzi

- IZ4UFQ -

"Il massimo danno con il minimo sforzo"


bug reassigned from package 'src:sysvinit' to 'sysvinit'. Request was from Mark Hindley <mark@hindley.org.uk> to control@bugs.devuan.org. (Sun, 21 Nov 2021 14:08:20 GMT) (full text, mbox, link).


Marked as found in versions 2.96-7+devuan1. Request was from Mark Hindley <mark@hindley.org.uk> to control@bugs.devuan.org. (Sun, 21 Nov 2021 14:08:20 GMT) (full text, mbox, link).


Marked as fixed in versions 3.00-1+devuan1. Request was from Mark Hindley <mark@hindley.org.uk> to control@bugs.devuan.org. (Sun, 21 Nov 2021 14:08:20 GMT) (full text, mbox, link).


Reply sent to dak@devuan.org:
You have taken responsibility. (Fri, 26 Nov 2021 16:34:02 GMT) (full text, mbox, link).


Notification sent to Fabio Muzzi <debianbugs@kurgan.org>:
bug acknowledged by developer. (Fri, 26 Nov 2021 16:34:05 GMT) (full text, mbox, link).


Message #51 received at 633-done@bugs.devuan.org (full text, mbox, reply):

From: dak@devuan.org
To: 633-done@bugs.devuan.org
Subject: #633: fixed in src:sysvinit version 2.96-7+devuan2
Date: Fri, 26 Nov 2021 16:32:11 +0000
Version: 2.96-7+devuan2

Source package sysvinit (2.96-7+devuan2) added to Devuan suite chimaera.

This closes bug report 633.

Thanks

DAK managing the Devuan archive

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 26 Nov 2021 16:21:12 +0000
Source: sysvinit
Architecture: source
Version: 2.96-7+devuan2
Distribution: chimaera
Urgency: medium
Maintainer: Devuan Developers <devuan-dev@lists.dyne.org>
Changed-By: Mark Hindley <mark@hindley.org.uk>
Closes: 633
Changes:
 sysvinit (2.96-7+devuan2) chimaera; urgency=medium
 .
   * Backport upstream patch to fix parsing of shutdown +0 (Closes: #633).
Checksums-Sha1:
 91159b1f9b92cbe8ce975ae875f08b72e841da3b 2029 sysvinit_2.96-7+devuan2.dsc
 2a0e1481bd934b3f3da0ec6ea78291595f7008cb 130308 sysvinit_2.96-7+devuan2.debian.tar.xz
 1976be3036a04540b3edc0d45bd523a00e7be47e 5206 sysvinit_2.96-7+devuan2_source.buildinfo
Checksums-Sha256:
 772a2ad2d7c1d24585fec36957e368fb0d4bfb0bd193f9cf7a54298c8085f4c4 2029 sysvinit_2.96-7+devuan2.dsc
 c20e7b4777cfc6eefc1b1cdc66f63b0680b22ddb80316608470ea491f9b8ad9b 130308 sysvinit_2.96-7+devuan2.debian.tar.xz
 29c400c512dad4b02e1b9e9389a849bd1f89a5d387e8aaec49cf69891df2c660 5206 sysvinit_2.96-7+devuan2_source.buildinfo
Files:
 9010ea3350de950987c31e739fdd7303 2029 admin required sysvinit_2.96-7+devuan2.dsc
 80ec0248d5631f4f58676ae099194d96 130308 admin required sysvinit_2.96-7+devuan2.debian.tar.xz
 79393fb45a27f5448f65ecd020e6a76d 5206 admin required sysvinit_2.96-7+devuan2_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEcuPLdzMV36LkZHQ9lFMhJFQZIvsFAmGhCwAACgkQlFMhJFQZ
IvuP9Qf+MHVOxJtGksYGcDDh8++364/wxtql4p/NK5FEIiRVSqGRBTZZDbN8A50A
Cf3hxR+Dtw8nB+ozlE9AbRGMDyMTM2K6Cz8Vw1/rhcpLTxL21VgI+EfcU9Q18Csf
WJr1mJxLqQSWp0UmlguGJa7Rkdc+5JY62NCvu73Q5rX6huQ0NxXbj6ujHeAIqlqj
bkucuiBp87CbNfLCENMFtgUQ/INDq19Q9CktxYs9+8P3rCe/lRf0+829+oRplup9
wLo2eTGpnPCuu85nTlDKvNJ+Q5cHdxpqD9LacYuLg2VWgGoeCzDNq/bfZjC3q8DU
cDa/6LKvXx1clrILIVgFAk64KPbKkQ==
=qCGm
-----END PGP SIGNATURE-----

Send a report that this bug log contains spam.


Devuan BTS -- Powered by Debian bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.

Devuan Bugs Owner <owner@bugs.devuan.org>.
Last modified: Sat Nov 23 23:55:04 2024;