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

Package: nbd-client; Reported by: David Kuehling <>; dated Mon, 16 Jul 2018 00:03:01 UTC; Maintainer for nbd-client is (unknown).

Message received at

Received: (at submit) by; 16 Jul 2018 00:00:03 +0000
Return-Path: <>
Received: from []
	by fulcanelli with IMAP (fetchmail-6.3.26)
	for <debbugs@localhost> (single-drop); Mon, 16 Jul 2018 02:00:03 +0200 (CEST)
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by (Postfix) with ESMTPS id 01470F60ABC
	for <>; Mon, 16 Jul 2018 01:55:30 +0200 (CEST)
	dkim=pass (2048-bit key; secure) header.b="k5aWO0Lp";
Received: from submission ( []) 
	by (Postfix) with ESMTPS id CA8202111A
	for <>; Mon, 16 Jul 2018 01:52:52 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;; s=2017;
	t=1531698772; bh=MbqyJhXJhX1pwz1o3aOJUCmWrKAIs+Es4rodC5gw7Tw=;
Received: from customer (localhost [])
	by submission ( with ESMTPSA id 41TNdb5yPyz9rxD
	for <>; Mon, 16 Jul 2018 01:52:51 +0200 (CEST)
From: David Kuehling <>
To: Devuan Bug Tracking System <>
Subject: nbd-client: At shutdown nbd-client disabled before file-systems could be cleanly unmounted
X-Debbugs-CC: David Kuehling <>
Date: Mon, 16 Jul 2018 01:52:51 +0200
Message-ID: <87r2k4njjg.fsf@snail.snail.pool>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on

Package: nbd-client
Version: 1:3.15.2-3
Severity: normal

Dear Maintainer,

I'm currently running a Devuan desktop without local storage using
pxelinux and root located on a network block device provided via
nbd-client (kernel command line "root=/dev/mapper/vg-root

Unfortunately the sysvinit tools and init scripts and the nbd-client
binary do not properly work together causing nbd-client to disconnect at
shutdown before the filesystems can be properly unmounted.

This seems to be a very old problem documented e.g. here [1] and here
[2] and it seems that systemd already got specific patches to prevent
that problem.  With only sysvinit left to exhibit the problem, this sort
of makes the bug devuan-specific (or should I still bother to report it
to debian?).

Short summary of the problem: during shutdown /etc/init.d/sendsigs calls
killall5 binary from sysvinit-utils, killing almost all running

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

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?  Fix
nbd-client?  Note that for nbd-root installations nbd-client is run via
(a copy of) /usr/share/initramfs-tools/scripts/local-top/nbd and not via

Other than that I'm very happy with the stability and maturity of
Devuan.  Running the installer on a diskless system, installing into a
network block device (with cryptsetup and LVM on top), then still being
able to boot the system without problems was sort of surprising :)




-- System Information:
Distributor ID:	Devuan
Description:	Devuan GNU/Linux 2.0 (ascii)
Release:	2.0
Codename:	ascii

Architecture: x86_64

Kernel: Linux 4.9.0-6-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages nbd-client depends on:
ii  debconf [debconf-2.0]  1.5.61
ii  libc6                  2.24-11+deb9u3
ii  libgnutls30            3.5.8-5+deb9u3

nbd-client recommends no packages.

nbd-client suggests no packages.

-- debconf information:

Acknowledgement sent to David Kuehling <>:
New bug report received and forwarded. Copy sent to David Kuehling <>, Full text available.
Report forwarded to, David Kuehling <>,
bug#227; Package nbd-client. 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 <>.
Last modified: Sun, 29 Jan 2023 16:39:01 UTC