Devuan bug report logs - #921
sane-utils: init script prompts for file removal when status is queried by nonroot user

version graph

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

Reported by: Alexander Rehbein <rehbein.alexander@gmail.com>

Date: Fri, 31 Oct 2025 17:04:01 UTC

Severity: normal

Tags: debian, patch, upstream

Found in version 1.2.1-2

Full log


🔗 View this message in rfc822 format

X-Loop: owner@bugs.devuan.org
Subject: bug#921: [devuan-dev] bug#921: sane-utils: init script prompts for file removal when status is queried by nonroot user
Reply-To: Andrew Bower <andrew@bower.uk>, 921@bugs.devuan.org
Resent-From: Andrew Bower <andrew@bower.uk>
Resent-To: devuan-bugs@lists.dyne.org
Resent-CC: Devuan developers <devuan-dev@lists.dyne.org>
X-Loop: owner@bugs.devuan.org
Resent-Date: Sun, 02 Nov 2025 00:14:03 +0000
Resent-Message-ID: <handler.921.B921.176204241425385@bugs.devuan.org>
Resent-Sender: owner@bugs.devuan.org
X-Devuan-PR-Message: followup 921
X-Devuan-PR-Package: sane-utils
X-Devuan-PR-Keywords: patch upstream
References: <176193010207.1104.13037963498210612981.reportbug@localhost> <176193010207.1104.13037963498210612981.reportbug@localhost>
X-Devuan-PR-Source: sane-backends
Received: via spool by 921-submit@bugs.devuan.org id=B921.176204241425385
          (code B ref 921); Sun, 02 Nov 2025 00:14:03 +0000
Received: (at 921) by bugs.devuan.org; 2 Nov 2025 00:13:34 +0000
Delivered-To: bugs@devuan.org
Received: from email.devuan.org [2a01:4f9:fff1:13::5fd9:f9e4]
	by doc.devuan.org with IMAP (fetchmail-6.4.39)
	for <debbugs@localhost> (single-drop); Sun, 02 Nov 2025 00:13:34 +0000 (UTC)
Received: from email.devuan.org
	by email.devuan.org with LMTP
	id udHRK+WhBmklFwAAmSBk0A
	(envelope-from <andrew@bower.uk>)
	for <bugs@devuan.org>; Sun, 02 Nov 2025 00:12:21 +0000
Received: by email.devuan.org (Postfix, from userid 109)
	id 9A5C4182; Sun, 02 Nov 2025 00:12:21 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS,
	T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1098:0:86:1000:0:2:1; helo=mx1.mythic-beasts.com; envelope-from=andrew@bower.uk; receiver=bugs.devuan.org 
Received: from mx1.mythic-beasts.com (mx1.mythic-beasts.com [IPv6:2a00:1098:0:86:1000:0:2:1])
	by email.devuan.org (Postfix) with ESMTPS id 8EDBCB9
	for <921@bugs.devuan.org>; Sun, 02 Nov 2025 00:12:20 +0000 (UTC)
Received: by mailhub-cam-d.mythic-beasts.com with esmtpsa  (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
	(Exim 4.96)
	(envelope-from <andrew@bower.uk>)
	id 1vFLhj-0066fL-2N;
	Sun, 02 Nov 2025 00:12:19 +0000
Received: from ajb85 by arden.ab8.net with local (Exim 4.98.2)
	(envelope-from <andrew@bower.uk>)
	id 1vFLhh-000000003Gi-1O5C;
	Sun, 02 Nov 2025 00:12:17 +0000
Date: Sun, 2 Nov 2025 00:12:17 +0000
From: Andrew Bower <andrew@bower.uk>
To: Alexander Rehbein <rehbein.alexander@gmail.com>, 921@bugs.devuan.org
Message-ID: <aQah4S2Qh1EVHgQz@arden.ab8.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <176193010207.1104.13037963498210612981.reportbug@localhost>
User-Agent: Mutt/2.2.13 (2024-03-09)
X-BlackCat-Spam-Score: 0
Hi Alexander,

Some comments as an observer.

On Fri, Oct 31, 2025 at 06:01:42PM +0100, Alexander Rehbein wrote:
> when running the command '/usr/sbin/service --status-all' as nonroot,
> the script hangs inside '/etc/init.d/saned' until I press 'Enter'.
> Same for '/usr/sbin/service saned status'.
> 
> I would expect the command to just finish outputting all statuses.
> 
> It's an easy fix, just add the '-f' flag to the 'rm' command.
> 
> I did this and now both commands run through for nonroot without waiting for input.

I don't like the idea that a status check is destructive but I can see
why the initscript author did that, to clean up inconsistent state. In
that light, I agree your workaround is an improvement.

The root cause of this issue seems to be that saned does not remove
its pidfile. It would be nice to get that fixed upstream.

But we can also improve the issue in the initscript like so:


--- debian/sane-utils.saned.init	2025-11-01 23:30:39.852645419 +0000
+++ /etc/init.d/saned	2025-11-01 23:20:42.507591180 +0000
@@ -47,6 +47,7 @@
   stop)
 	log_daemon_msg "Stopping $DESC" "$NAME"
 	start-stop-daemon --stop --oknodo --quiet --pidfile /var/run/$NAME.pid \
+		--remove-pidfile \
 		--retry 10 --exec $DAEMON
 	log_end_msg $?
 	;;


The init-d-script(5) interpreter actually deletes the pid file
unconditionally so an even better way might be to swap out the entire
initscript with a simpler one using init-d-script.

Out of interest, do you use the saned server?

I suspect most users of this package don't and I was already considering
proposing that the initscript is disabled by default, which would match
the systemd behaviour, which personally I think is the right thing to do
although might not be the majority view in Devuan:


diff --git a/debian/rules b/debian/rules
index 1b0243f..d0ecb43 100755
--- a/debian/rules
+++ b/debian/rules
@@ -148,7 +148,7 @@ ifeq (linux,$(DEB_HOST_ARCH_OS))
 endif
 
 override_dh_installinit-arch:
-       dh_installinit -psane-utils --name=saned
+       dh_installinit -psane-utils --no-enable --name=saned
 
 override_dh_installsystemd-arch:
        dh_installsystemd -psane-utils --no-enable --name=saned


-- 
Andrew

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: Fri Nov 7 21:35:34 2025;