Devuan bug report logs - #617
initscripts: brightness init script sets brightness to zero, thus blanking laptop display

version graph

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

Reported by: Martin Steigerwald <martin@lichtvoll.de>

Date: Mon, 11 Oct 2021 16:22:02 UTC

Severity: normal

Tags: patch

Found in version 2.96-7+devuan1

Fixed in version 3.06-4devuan3

Done: dak@devuan.org

Full log


🔗 View this message in rfc822 format

X-Loop: owner@bugs.devuan.org
Subject: bug#617: initscripts: brightness init script sets brightness to zero, thus blanking laptop display
Reply-To: Martin Steigerwald <martin@lichtvoll.de>, 617@bugs.devuan.org
Resent-From: Martin Steigerwald <martin@lichtvoll.de>
Resent-To: devuan-bugs@lists.dyne.org
Resent-CC: Devuan Developers <devuan-dev@lists.dyne.org>
X-Loop: owner@bugs.devuan.org
Resent-Date: Tue, 12 Oct 2021 07:42:01 +0000
Resent-Message-ID: <handler.617.B617.16340244036698@bugs.devuan.org>
Resent-Sender: owner@bugs.devuan.org
X-Devuan-PR-Message: followup 617
X-Devuan-PR-Package: initscripts
X-Devuan-PR-Keywords: 
References: <163396916488.2227.13166665119512005807.reportbug@om.lichtvoll> <YWRvJJnsD+v5A71P@hindley.org.uk> <163396916488.2227.13166665119512005807.reportbug@om.lichtvoll>
Received: via spool by 617-submit@bugs.devuan.org id=B617.16340244036698
          (code B ref 617); Tue, 12 Oct 2021 07:42:01 +0000
Received: (at 617) by bugs.devuan.org; 12 Oct 2021 07:40:03 +0000
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); Tue, 12 Oct 2021 07:40:03 +0000 (UTC)
Received: from mail.lichtvoll.de (luna.lichtvoll.de [194.150.191.11])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by vm6.ganeti.dyne.org (Postfix) with ESMTPS id AFA48F60A50
	for <617@bugs.devuan.org>; Tue, 12 Oct 2021 09:36:34 +0200 (CEST)
Received: from ananda.localnet (unknown [IPv6:2001:a62:1a8c:8a00:4426:352e:804d:598])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by mail.lichtvoll.de (Postfix) with ESMTPSA id F2DC02D995E;
	Tue, 12 Oct 2021 09:36:29 +0200 (CEST)
From: Martin Steigerwald <martin@lichtvoll.de>
To: 617@bugs.devuan.org, Mark Hindley <mark@hindley.org.uk>
Date: Tue, 12 Oct 2021 09:36:24 +0200
Message-ID: <3683879.6dGg56flLl@ananda>
In-Reply-To: <YWRvJJnsD+v5A71P@hindley.org.uk>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
Authentication-Results: mail.lichtvoll.de;
	auth=pass smtp.auth=martin2 smtp.mailfrom=martin@lichtvoll.de
X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled
	version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org
Dear Mark.

Mark Hindley - 11.10.21, 19:06:44 CEST:
> Thanks for this.
> 
> The brightness initscript seems to save
> /sys/class/backlight/intel_backlight/brightness to
> /var/lib/initscripts/brightness when it is stopped.
> 
> On your system, what does the
> /sys/class/backlight/intel_backlight/brightness contain?

I think I know what happened.

After booting the laptop I get:

% cat /sys/class/backlight/intel_backlight/brightness
512

However after KDE Plasma blanked the screen due to inactivity I got:

% cat /sys/class/backlight/intel_backlight/brightness
0

Now when I shutdown the system regularly using the GUI, Plasma would 
raise the brightness again as I move the mouse pointer. However, when I 
reboot from SSH as I did yesterday after the update, it won't.

The script takes writes zero into its state file and that it is.

Due to that I think the whole assumption that it is a sane idea to 
restore the backlight state to what has been set at the time of 
rebooting is fundamentally broken.

Actually it was one of the reasons why I switched from systemd to runit. 
Cause at one point Systemd in Debian was configured to do something 
similar and it causes some of my machines to boot up with blank and at a 
later at least very dark display.

Of course you may argue not to reboot a desktop machine via SSH. But why 
wouldn't I do so for my music player laptop?

I do not have a good idea on how to fix this issue at the moment. A work-
around would be to ensure a minimum brightness of at least 10% or 20%. 
Another idea would be to tell the desktop environment to unblank the 
screen before logging off or ask the desktop environment developers to do 
so in all cases. Or you'd just use say 80% of brightness as a default 
value and put a file into /etc to let the user manually configure it.

The best solution would be to somehow grab the *intended* brightness 
value during operation and not ever take the one during inactivity where 
the screen is blanked. But also this depends on the desktop environment. 
So… it is likely to become messy and complex.

My personal work-around for now will likely be to disable the stop 
operation of that script.

Best,
-- 
Martin

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: Sat Nov 23 19:10:28 2024;