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

Full log


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

Received: (at 633) by bugs.devuan.org; 20 Nov 2021 23:00:01 +0000
Return-Path: <debianbugs@kurgan.org>
Delivered-To: devuanbugs@dyne.org
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 <633@bugs.devuan.org>; 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 header.i=@kurgan.org 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 <debianbugs@kurgan.org>)
	id 1moZFd-0002L1-JP
	for 633@bugs.devuan.org; Sat, 20 Nov 2021 23:54:29 +0100
To: 633@bugs.devuan.org
From: Fabio Muzzi <debianbugs@kurgan.org>
Subject: gdb trace - and a workaround
Message-ID: <2089ef48-eb48-7c39-d4d1-2c400d502fbc@kurgan.org>
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"


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: Mon Apr 29 07:52:53 2024;