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

Package: sysvinit; Severity: grave; Reported by: Fabio Muzzi <[email protected]>; Keywords: chimaera; Done: [email protected]; Maintainer for sysvinit is Devuan Developers <[email protected]>.

Message received at [email protected]:


Received: (at 633-done) by bugs.devuan.org; 26 Nov 2021 16:33:08 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Fri, 26 Nov 2021 16:33:08 +0000 (UTC)
Received: from mail.devuan.dev (mail.devuan.dev [54.36.142.182])
	by vm6.ganeti.dyne.org (Postfix) with ESMTP id 41D17F60BAE
	for <[email protected]>; Fri, 26 Nov 2021 17:32:13 +0100 (CET)
Received: from dak.ganeti1.devuan.org (dak.localnet.devuan.org [192.168.97.90])
	by mail.devuan.dev (Postfix) with SMTP id 155613A19F6
	for <[email protected]>; Fri, 26 Nov 2021 16:32:12 +0000 (UTC)
Received: (nullmailer pid 725 invoked by uid 107);
	Fri, 26 Nov 2021 16:32:11 -0000
From: [email protected]
To: [email protected]
Subject: #633: fixed in src:sysvinit version 2.96-7+devuan2
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
Date: Fri, 26 Nov 2021 16:32:11 +0000
Message-Id: <[email protected]>
X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_FAIL
	autolearn=disabled version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org


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 <[email protected]>
Changed-By: Mark Hindley <[email protected]>
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-----

Notification sent to Fabio Muzzi <[email protected]>:
bug acknowledged by developer. Full text available.
Reply sent to [email protected]:
You have taken responsibility. Full text available.
Marked as fixed in versions 3.00-1+devuan1. Request was from Mark Hindley <[email protected]> to [email protected]. Full text available.
Marked as found in versions 2.96-7+devuan1. Request was from Mark Hindley <[email protected]> to [email protected]. Full text available.
bug reassigned from package 'src:sysvinit' to 'sysvinit'. Request was from Mark Hindley <[email protected]> to [email protected]. Full text available.

Message received at [email protected]:


Received: (at 633) by bugs.devuan.org; 21 Nov 2021 14:07:57 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Sun, 21 Nov 2021 14:07:57 +0000 (UTC)
Received: from mail.kurgan.org (mail.kurgan.org [79.98.45.243])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by vm6.ganeti.dyne.org (Postfix) with ESMTPS id E563BF609E9
	for <[email protected]>; Sun, 21 Nov 2021 15:00:41 +0100 (CET)
Authentication-Results: vm6.ganeti.dyne.org;
	dkim=pass (1024-bit key; unprotected) header.d=kurgan.org [email protected] header.b="gKH6JFqb";
	dkim-atps=neutral
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kurgan.org;
	 s=dkim; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date:
	Message-ID:Subject:From:To:Sender:Reply-To:Cc:Content-ID:Content-Description:
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
	In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
	List-Post:List-Owner:List-Archive;
	bh=Gsn+N7s1lI7SVuZwhSHQ4bkVB4YnySy9WZgXEehOj/I=; b=gKH6JFqbKqFtTMj2zvKGErsUEH
	87iZqXM+iY2nHrwdbeElMGDHV1k1xVCku2rv2U/PE9BD4OFW+oVIoHTclQmflOEcjmz4tF4KbiLQw
	5n0i4hBJ5BYmA1RX91uSdJ83pL8HCYHzqMHH7aCjw6cYCtlvGic4MuxHLKyqZ02/5zzU=;
Received: from [151.42.155.27] (port=55144 helo=[172.31.255.3])
	by mail.kurgan.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128)
	(Exim 4.92)
	(envelope-from <[email protected]>)
	id 1monOZ-0004WG-6Q
	for [email protected]; Sun, 21 Nov 2021 15:00:39 +0100
To: [email protected]
From: Fabio Muzzi <[email protected]>
Subject: sysvinit-core from backports works - FIXED
Message-ID: <[email protected]>
Date: Sun, 21 Nov 2021 15:00:38 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
 Thunderbird/78.14.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,DKIM_VALID_EF,SPF_PASS autolearn=disabled version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org


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"


Acknowledgement sent to Fabio Muzzi <[email protected]>:
Extra info received and forwarded to list. Copy sent to Vincenzo (KatolaZ) Nicosia <[email protected]>. Full text available.
Information forwarded to [email protected], Vincenzo (KatolaZ) Nicosia <[email protected]>:
bug#633; Package src:sysvinit. Full text available.

Message received at [email protected]:


Received: (at 633) by bugs.devuan.org; 21 Nov 2021 12:55:52 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Sun, 21 Nov 2021 12:55:52 +0000 (UTC)
Received: from mx.hindley.org.uk (193-36-131-86.cfwn.uk [193.36.131.86])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by vm6.ganeti.dyne.org (Postfix) with ESMTPS id 74037F604A1
	for <[email protected]>; Sun, 21 Nov 2021 13:49:00 +0100 (CET)
Received: from apollo.hindleynet ([192.168.1.3] helo=hindley.org.uk)
	by mx.hindley.org.uk with smtp (Exim 4.84_2)
	(envelope-from <[email protected]>)
	id 1momHC-0004JW-T2; Sun, 21 Nov 2021 12:48:58 +0000
Received: (nullmailer pid 23834 invoked by uid 1000);
	Sun, 21 Nov 2021 12:48:57 -0000
Date: Sun, 21 Nov 2021 12:48:57 +0000
From: Mark Hindley <[email protected]>
To: [email protected], Fabio Muzzi <[email protected]>
Subject: Re: bug#633: Actually sysvinit /sbin/shutdown's fault
Message-ID: <[email protected]>
References: <163743517558.1458.16031504645366650167.reportbug@fileserver.geldue.locale>
 <[email protected]>
 <[email protected]>
 <163743517558.1458.16031504645366650167.reportbug@fileserver.geldue.locale>
 <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[email protected]>
X-Debbugs-No-Ack: No Thanks
X-Spam-Status: No, score=0.4 required=5.0 tests=RDNS_DYNAMIC,SPF_PASS
	autolearn=disabled version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org

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 [email protected], Vincenzo (KatolaZ) Nicosia <[email protected]>:
bug#633; Package src:sysvinit. Full text available.

Message received at [email protected]:


Received: (at 633) by bugs.devuan.org; 21 Nov 2021 12:55:47 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Sun, 21 Nov 2021 12:55:47 +0000 (UTC)
Received: from mx.hindley.org.uk (193-36-131-86.cfwn.uk [193.36.131.86])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by vm6.ganeti.dyne.org (Postfix) with ESMTPS id 63A0EF609EF
	for <[email protected]>; Sun, 21 Nov 2021 13:32:54 +0100 (CET)
Received: from apollo.hindleynet ([192.168.1.3] helo=hindley.org.uk)
	by mx.hindley.org.uk with smtp (Exim 4.84_2)
	(envelope-from <[email protected]>)
	id 1mom1c-0004Cp-2N; Sun, 21 Nov 2021 12:32:52 +0000
Received: (nullmailer pid 23370 invoked by uid 1000);
	Sun, 21 Nov 2021 12:32:51 -0000
Date: Sun, 21 Nov 2021 12:32:51 +0000
From: Mark Hindley <[email protected]>
To: Fabio Muzzi <[email protected]>, [email protected]
Subject: Re: bug#633: Actually sysvinit /sbin/shutdown's fault
Message-ID: <[email protected]>
References: <163743517558.1458.16031504645366650167.reportbug@fileserver.geldue.locale>
 <[email protected]>
 <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[email protected]>
X-Debbugs-No-Ack: No Thanks
X-Spam-Status: No, score=0.4 required=5.0 tests=RDNS_DYNAMIC,SPF_PASS
	autolearn=disabled version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org

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

Information forwarded to [email protected], Vincenzo (KatolaZ) Nicosia <[email protected]>:
bug#633; Package src:sysvinit. Full text available.
Added tag(s) chimaera; removed tag(s) debian. Request was from Mark Hindley <[email protected]> to [email protected]. Full text available.
No longer marked as found in versions 1:5.2+dfsg-11+deb11u1. Request was from Mark Hindley <[email protected]> to [email protected]. Full text available.
bug reassigned from package 'qemu-guest-agent' to 'src:sysvinit'. Request was from Mark Hindley <[email protected]> to [email protected]. Full text available.

Message received at [email protected]:


Received: (at 633) by bugs.devuan.org; 21 Nov 2021 12:40:03 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Sun, 21 Nov 2021 12:40:03 +0000 (UTC)
Received: from mx.hindley.org.uk (193-36-131-86.cfwn.uk [193.36.131.86])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by vm6.ganeti.dyne.org (Postfix) with ESMTPS id 63A0EF609EF
	for <[email protected]>; Sun, 21 Nov 2021 13:32:54 +0100 (CET)
Received: from apollo.hindleynet ([192.168.1.3] helo=hindley.org.uk)
	by mx.hindley.org.uk with smtp (Exim 4.84_2)
	(envelope-from <[email protected]>)
	id 1mom1c-0004Cp-2N; Sun, 21 Nov 2021 12:32:52 +0000
Received: (nullmailer pid 23370 invoked by uid 1000);
	Sun, 21 Nov 2021 12:32:51 -0000
Date: Sun, 21 Nov 2021 12:32:51 +0000
From: Mark Hindley <[email protected]>
To: Fabio Muzzi <[email protected]>, [email protected]
Subject: Re: bug#633: Actually sysvinit /sbin/shutdown's fault
Message-ID: <[email protected]>
References: <163743517558.1458.16031504645366650167.reportbug@fileserver.geldue.locale>
 <[email protected]>
 <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[email protected]>
X-Debbugs-No-Ack: No Thanks
X-Spam-Status: No, score=0.4 required=5.0 tests=RDNS_DYNAMIC,SPF_PASS
	autolearn=disabled version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org

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

Information forwarded to [email protected], [email protected]:
bug#633; Package qemu-guest-agent. Full text available.
Added tag(s) debian. Request was from Mark Hindley <[email protected]> to [email protected]. Full text available.

Message received at [email protected]:


Received: (at 633) by bugs.devuan.org; 21 Nov 2021 09:30:04 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Sun, 21 Nov 2021 09:30:04 +0000 (UTC)
Received: from mx.hindley.org.uk (193-36-131-86.cfwn.uk [193.36.131.86])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by vm6.ganeti.dyne.org (Postfix) with ESMTPS id 0CC9CF60AC0
	for <[email protected]>; Sun, 21 Nov 2021 10:28:00 +0100 (CET)
Received: from apollo.hindleynet ([192.168.1.3] helo=hindley.org.uk)
	by mx.hindley.org.uk with smtp (Exim 4.84_2)
	(envelope-from <[email protected]>)
	id 1moj8g-00032H-I4; Sun, 21 Nov 2021 09:27:58 +0000
Received: (nullmailer pid 18177 invoked by uid 1000);
	Sun, 21 Nov 2021 09:27:57 -0000
Date: Sun, 21 Nov 2021 09:27:57 +0000
From: Mark Hindley <[email protected]>
To: Fabio Muzzi <[email protected]>, [email protected]
Subject: Re: bug#633: gdb trace - and a workaround
Message-ID: <[email protected]>
References: <163743517558.1458.16031504645366650167.reportbug@fileserver.geldue.locale>
 <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[email protected]>
X-Debbugs-No-Ack: No Thanks
X-Spam-Status: No, score=0.4 required=5.0 tests=RDNS_DYNAMIC,SPF_PASS
	autolearn=disabled version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org

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

Information forwarded to [email protected], [email protected]:
bug#633; Package qemu-guest-agent. Full text available.

Message received at [email protected]:


Received: (at 633) by bugs.devuan.org; 20 Nov 2021 23:00:01 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Sat, 20 Nov 2021 23:00:01 +0000 (UTC)
Received: from mail.kurgan.org (mail.kurgan.org [79.98.45.243])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by vm6.ganeti.dyne.org (Postfix) with ESMTPS id B316BF6096A
	for <[email protected]>; Sat, 20 Nov 2021 23:54:30 +0100 (CET)
Authentication-Results: vm6.ganeti.dyne.org;
	dkim=pass (1024-bit key; unprotected) header.d=kurgan.org [email protected] header.b="g6NmGN3x";
	dkim-atps=neutral
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kurgan.org;
	 s=dkim; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date:
	Message-ID:Subject:From:To:Sender:Reply-To:Cc:Content-ID:Content-Description:
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
	In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
	List-Post:List-Owner:List-Archive;
	bh=r2wX7fzSVuQh0UMbIMnlp1jCRM2bmKbnFjSi6V1xLuc=; b=g6NmGN3xhQDEJuNxnU7dKEzCJS
	ve0NK8eFnE0/v5UP5W81eMjMOYkOPAbnyzDjmJi0zoNNjp+WlgDL8W6WfXktDOyzXRZ4bLw79bXHB
	lXNNT3ba4CvipgCSjq74KM9EX7olcjG+c3bXe24pHxQ1tozyOhSfCx9lNqTAglqJClGI=;
Received: from [151.42.155.27] (port=53982 helo=[172.31.255.3])
	by mail.kurgan.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128)
	(Exim 4.92)
	(envelope-from <[email protected]>)
	id 1moZFd-0002L1-JP
	for [email protected]; Sat, 20 Nov 2021 23:54:29 +0100
To: [email protected]
From: Fabio Muzzi <[email protected]>
Subject: gdb trace - and a workaround
Message-ID: <[email protected]>
Date: Sat, 20 Nov 2021 23:54:29 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
 Thunderbird/78.14.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: it-IT
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,DKIM_VALID_EF,SPF_PASS autolearn=disabled version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org


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"


Acknowledgement sent to Fabio Muzzi <[email protected]>:
Extra info received and forwarded to list. Copy sent to [email protected]. Full text available.
Information forwarded to [email protected], [email protected]:
bug#633; Package qemu-guest-agent. Full text available.

Message received at [email protected]:


Received: (at 633) by bugs.devuan.org; 20 Nov 2021 21:40:04 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Sat, 20 Nov 2021 21:40:04 +0000 (UTC)
Received: from mail.kurgan.org (mail.kurgan.org [79.98.45.243])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by vm6.ganeti.dyne.org (Postfix) with ESMTPS id D414FF60B03
	for <[email protected]>; Sat, 20 Nov 2021 22:30:23 +0100 (CET)
Authentication-Results: vm6.ganeti.dyne.org;
	dkim=pass (1024-bit key; unprotected) header.d=kurgan.org [email protected] header.b="g8eCgw9S";
	dkim-atps=neutral
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kurgan.org;
	 s=dkim; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date:
	Message-ID:Subject:From:To:Sender:Reply-To:Cc:Content-ID:Content-Description:
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
	In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
	List-Post:List-Owner:List-Archive;
	bh=HI1jRUMWpDFX4+TMiTWNNyxroTwGv2yXFyYUqXvnBbM=; b=g8eCgw9SjVlAn3pJrYfDjggrAI
	tpQw3CWKLFzUvyaVdDzNl808OTpXtX0VhSFR/oNIvDs4lZuMon+sLJFh8nK7b6mrP+Z8dFZBYFm+m
	UEi7qTbYFA2Tux+7NSNMSmuw4RHWuYJ/j1w0BUDZDtSh1dPo1Gsn7aEZKvVzwyh857uo=;
Received: from [151.42.155.27] (port=52162 helo=[172.31.255.3])
	by mail.kurgan.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128)
	(Exim 4.92)
	(envelope-from <[email protected]>)
	id 1moXwD-00027x-Ur
	for [email protected]; Sat, 20 Nov 2021 22:30:21 +0100
To: [email protected]
From: Fabio Muzzi <[email protected]>
Subject: Adding a debug session...
Message-ID: <[email protected]>
Date: Sat, 20 Nov 2021 22:30:21 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
 Thunderbird/78.14.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: it-IT
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,DKIM_VALID_EF,SPF_PASS autolearn=disabled version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org


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"


Acknowledgement sent to Fabio Muzzi <[email protected]>:
Extra info received and forwarded to list. Copy sent to [email protected]. Full text available.
Information forwarded to [email protected], [email protected]:
bug#633; Package qemu-guest-agent. Full text available.

Message received at [email protected]:


Received: (at submit) by bugs.devuan.org; 20 Nov 2021 19:10:02 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Sat, 20 Nov 2021 19:10:02 +0000 (UTC)
Received: from fileserver.geldue.locale (host238-61-234-109.static.ehiweb.it [109.234.61.238])
	by vm6.ganeti.dyne.org (Postfix) with ESMTP id 3D8BFF60934
	for <[email protected]>; Sat, 20 Nov 2021 20:07:03 +0100 (CET)
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Fabio Muzzi <[email protected]>
To: Devuan Bug Tracking System <[email protected]>
Subject: qemu-guest-agent: Guest agent does not shut down the guest when requested to
Message-ID: <163743517558.1458.16031504645366650167.reportbug@fileserver.geldue.locale>
Date: Sat, 20 Nov 2021 20:06:15 +0100
X-Spam-Status: No, score=1.0 required=5.0 tests=SPF_SOFTFAIL
	autolearn=disabled version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org

Package: qemu-guest-agent
Version: 1:5.2+dfsg-11+deb11u1
Severity: grave
Justification: renders package unusable
X-Debbugs-Cc: [email protected]

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

Acknowledgement sent to Fabio Muzzi <[email protected]>:
New bug report received and forwarded. Copy sent to [email protected], [email protected]. Full text available.
Report forwarded to [email protected], [email protected], [email protected]:
bug#633; Package qemu-guest-agent. Full text available.

Devuan BTS -- Powered by Debian bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.

Devuan Bugs Owner <[email protected]>.
Last modified: Sun, 1 Dec 2024 00:39:02 UTC