Devuan bug report logs - #227
nbd-client: At shutdown nbd-client disabled before file-systems could be cleanly unmounted

version graph

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

Affects: nbd-client

Reported by: David Kuehling <dvdkhlng@posteo.de>

Date: Mon, 16 Jul 2018 00:03:01 UTC

Severity: normal

Tags: upstream

Fixed in version 3.07-1

Done: Mark Hindley <mark@hindley.org.uk>

Full log


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

Received: (at 227) by bugs.devuan.org; 16 Feb 2023 15:24:04 +0000
Return-Path: <mark@hindley.org.uk>
Delivered-To: bugs@devuan.org
Received: from email.devuan.org [2001:41d0:2:d06e::5c4:2612]
	by doc.devuan.org with IMAP (fetchmail-6.4.16)
	for <debbugs@localhost> (single-drop); Thu, 16 Feb 2023 15:24:04 +0000 (UTC)
Received: from email.devuan.org
	by email.devuan.org with LMTP
	id 2C6BFkZK7mPaTgAAmSBk0A
	(envelope-from <mark@hindley.org.uk>)
	for <bugs@devuan.org>; Thu, 16 Feb 2023 15:22:46 +0000
Received: by email.devuan.org (Postfix, from userid 109)
	id 53449A1; Thu, 16 Feb 2023 15:22:46 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on email.devuan.org
X-Spam-Level: 
X-Spam-Status: No, score=0.4 required=5.0 tests=RDNS_DYNAMIC,SPF_PASS
	autolearn=no autolearn_force=no version=3.4.6
Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=193.36.131.86; helo=mx.hindley.org.uk; envelope-from=mark@hindley.org.uk; receiver=<UNKNOWN> 
Received: from mx.hindley.org.uk (193-36-131-86.cfwn.uk [193.36.131.86])
	by email.devuan.org (Postfix) with ESMTPS id 01EE884
	for <227@bugs.devuan.org>; Thu, 16 Feb 2023 15:22:45 +0000 (UTC)
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 <mark@hindley.org.uk>)
	id 1pSg5s-0006MC-AX; Thu, 16 Feb 2023 15:22:44 +0000
Received: (nullmailer pid 12521 invoked by uid 1000);
	Thu, 16 Feb 2023 15:22:44 -0000
Date: Thu, 16 Feb 2023 15:22:44 +0000
From: Mark Hindley <mark@hindley.org.uk>
To: David Kuehling <dvdkhlng@posteo.de>, 227@bugs.devuan.org
Cc: jsmith@resonatingmedia.com
Subject: Re: bug#227: nbd-client: At shutdown nbd-client disabled before
 file-systems could be cleanly unmounted
Message-ID: <Y+5KRGlB5crallrj@hindley.org.uk>
References: <87r2k4njjg.fsf@snail.snail.pool>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <87r2k4njjg.fsf@snail.snail.pool>
X-Debbugs-No-Ack: No Thanks
Control: tags -1 upstream

David,

I know it has been a long time, but thanks for this.

On Mon, Jul 16, 2018 at 01:52:51AM +0200, David Kuehling wrote:
> Short summary of the problem: during shutdown /etc/init.d/sendsigs calls
> killall5 binary from sysvinit-utils, killing almost all running
> processes.
> 
> Of course it never should kill nbd-client, so the /etc/init.d/nbd-client
> script is smart enough to register its PID to be exempt from sendsig's
> action: by recording it in the /run/sendsigs.omit.d/nbd-cient file.
> 
> These PIDs are then collected by /etc/init.d/sendsig and passed as "-o
> NNN" options to killall5 which spares those processes from premature
> termination.
> 
> However, before killall5 goes on to kill all the other processes, it
> does a:
> 
> 	/* Now stop all processes. */
> 	kill(-1, SIGSTOP);
> 
> And when it's done, it does:
> 
> 	/* And let them continue. */
> 	kill(-1, SIGCONT);
> 
> These SIGSTOP, SIGCONT signals are passed to all processes, including
> nbd-client.  Unfortunately nbd-client is written in a way that makes it
> unable to handle any signals delivered while it is inside an ioctl call,
> and it looses its server connection on SIGSTOP, totally breaking the
> block devices it provides.
> 
> What would be the right way to prevent this problem?  Fix sysvinit?

My inclination here is that killall5 shouldn't send any signals (including a
STOP CONT pair) to processes that have registered to be omitted.

Copying Jesse Smith the sysvinit maintainer.

Jesse what do you think? Is it possible to avoid that?

Thanks

Mark

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: Thu May 2 12:18:56 2024;