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 #15 received at 227@bugs.devuan.org (full text, mbox, reply):

Received: (at 227) by bugs.devuan.org; 16 Feb 2023 16:09:02 +0000
Return-Path: <jessefrgsmith@yahoo.ca>
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 16:09:02 +0000 (UTC)
Received: from email.devuan.org
	by email.devuan.org with LMTP
	id +kMcHQ1V7mPAUAAAmSBk0A
	(envelope-from <jessefrgsmith@yahoo.ca>)
	for <bugs@devuan.org>; Thu, 16 Feb 2023 16:08:45 +0000
Received: by email.devuan.org (Postfix, from userid 109)
	id 6B369A0; Thu, 16 Feb 2023 16:08:45 +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=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_PASS
	autolearn=ham autolearn_force=no version=3.4.6
Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=74.6.131.41; helo=sonic303-2.consmr.mail.bf2.yahoo.com; envelope-from=jessefrgsmith@yahoo.ca; receiver=<UNKNOWN> 
Received: from sonic303-2.consmr.mail.bf2.yahoo.com (sonic303-2.consmr.mail.bf2.yahoo.com [74.6.131.41])
	by email.devuan.org (Postfix) with ESMTPS id E175023
	for <227@bugs.devuan.org>; Thu, 16 Feb 2023 16:08:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.ca; s=s2048; t=1676563720; bh=lYAaoVVkvoFp8eGzQNijfdzhWuzZ67CRqdQLpeggQNQ=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject:Reply-To; b=jcHT5vbkBzB5plCOxxF8YfclaojSrr+KCdtRbqxOTs/h/eBYiGM92sV/7RKdUtRK/EgZRiVaTe8MF6Bckyc8H85WECDtLiihU1a4VZ2+A/HpG2q9BCIIgtJyFPDtYmuGN0Ans998EeveRqE64AED8CfMbbBxwB2VdIA2mD4ojTPwgIbD1QeZ++x3tmTM/nDU1rgod9pbE3hlrGM3Emc1xufECzpzW+4msmPn8AEw0GOgOTXrpdh7araK8E8x2MBI5o8px3c25BKQ+tEAlL+n0IKv3VYHqHVxXc+lRrDIYqDUwLCjGPxRwwKFK8S79Pm0WPVQuCCWG6n5yArrB7EAYA==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676563720; bh=HVJNN12j1GZB5hCuNuVMErfMwIzFF1UmDC8Grzzmc4p=; h=X-Sonic-MF:Subject:To:From:Date:From:Subject; b=C0JxSNl/soCgHtBkcGm51xbei3i9bNSJkrQLA6ANQD5cyCs5yXW8OU+AwgLrXu5Nh9933nVqcxWEWr6huBe8Lx/Ax+OCoZ+wK4L34JsmNX/nCgZHBUlSAulOcrtL+ALP9QUfQifk4zPrhS5mie4UkJj8o0DTBAG7KSzcF1i/ZZatU9ocJ+SGceqL66jZE4LmGykkfvizG+A0xs3VoIDyK+7BvCM76bK+kjeuA3HkO87Wru7FYoR3+q8pALy1u3aGs9ooxC45TPB7brG8aeqly8oiZbA0JK6pKxiDM78/Qy6Rx9ookwbUe0V9qRNZqR1ZDUZqyFiT/nIbIeDu5JVL3g==
X-YMail-OSG: AvtNiJkVM1mJl40OHLvQOI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rGb
 XIkR..qMyu9hB_aOOEL2lIBd4WQELKQi9UOTYXyrzVBmIyTxaKnjn3LjvlwKVWXQYLt7wSNY48is
 Vjqmg7JuVxojoRIbwL9jSNHhNDv1FwbTRSai5O4sTERCwp31rOUsi8GXfk8lPfd0BlqDt7P9N3pL
 yJsu4r_UBwkymt0nKHckuff4E1l1BzPvOhLFHq1Jax6Tf.74z6FH1DbEZ8IAP
X-Sonic-MF: <jessefrgsmith@yahoo.ca>
Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.bf2.yahoo.com with HTTP; Thu, 16 Feb 2023 16:08:40 +0000
Received: by hermes--production-gq1-655ddccc9-nql2v (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 812ef8049f229529834550bd7cb8832e;
          Thu, 16 Feb 2023 16:08:37 +0000 (UTC)
Subject: Re: bug#227: nbd-client: At shutdown nbd-client disabled before
 file-systems could be cleanly unmounted
To: Mark Hindley <mark@hindley.org.uk>, David Kuehling <dvdkhlng@posteo.de>,
 227@bugs.devuan.org
References: <87r2k4njjg.fsf@snail.snail.pool>
 <Y+5KRGlB5crallrj@hindley.org.uk>
From: Jesse Smith <jessefrgsmith@yahoo.ca>
Message-ID: <04de2f47-f31f-9214-2ed0-7edd2f83985e@yahoo.ca>
Date: Thu, 16 Feb 2023 12:08:34 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
 Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <Y+5KRGlB5crallrj@hindley.org.uk>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Content-Language: en-CA
X-Mailer: WebService/1.1.21183 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
On 2023-02-16 11:22 a.m., Mark Hindley wrote:
> 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 for the detailed bug report and explanation.

The way I see it this probably is a bug in the way killall5 operates. If
we've been explicitly told not to send signals to a process, then we
shouldn't send any signals to that process. It shouldn't matter if the
signal is STOP, CONT, or TERM.

I see two possible ways we could fix this:

1. Create a command line flag which disables the SIGSTOP and SIGCONT
signals being sent. This is an easy fix, quick and dirty. The potential
downside is if someone disables the STOP signal then maybe processes
terminate, move groups, or are replaced before we get around to sending
them the KILL signal. This probably won't happen, but it means killall5
is working with a "moving target".

2. We can run SIGSTOP on all processes _except_ those in the omit list.
This will be a lot slower than the existing "kill(-1, SIGSTOP)" call we
currently make. But I think it's more correct.

Basically the new work flow would look like this:

1. Send all processes except those omitted the SIGSTOP command.
2. Send all processes except those omitted the SIGKILL command.
3. Send all processes except those omitted the SIGCONT command.

Option #2 is slow and ugly, but seems "correct" from a behaviour point
of view.

I'm open to comments before I patch this.

- Jesse


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 08:39:43 2024;