NetBSD Problem Report #52398

From www@NetBSD.org  Wed Jul 12 11:53:01 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 552797A217
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 12 Jul 2017 11:53:01 +0000 (UTC)
Message-Id: <20170712115300.5EF817A2A1@mollari.NetBSD.org>
Date: Wed, 12 Jul 2017 11:53:00 +0000 (UTC)
From: chris@sogubsys.com
Reply-To: chris@sogubsys.com
To: gnats-bugs@NetBSD.org
Subject: Provide sleep ability in powerd lid_switch, even if commented out
X-Send-Pr-Version: www-1.0

>Number:         52398
>Category:       misc
>Synopsis:       Provide sleep ability in powerd lid_switch, even if commented out
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 12 11:55:00 +0000 2017
>Originator:     Chris Humphries
>Release:        7.1
>Organization:
>Environment:
NetBSD shrimpy.sogubsys.com 7.1 NetBSD 7.1 (GENERIC.201703111743Z) amd64
>Description:
Provide details of how to sleep on lid open/close in /etc/powerd/scripts/lid_switch, even if commented out. Referencing another script and decoding that could be improved upon for a better user experience. 

Maybe even briefly describe the magic values for sleep state and/or where to look like in acpi(4). 

I'd venture that most users expect a laptop to enter sleep mode when closing the lid and not just turn off the display. This is bad default behavior.


--snip--
root:shrimpy /etc/powerd/scripts>> diff lid_switch~ lid_switch
12a13,19
> 	/etc/rc.d/bluetooth stop
> 	/etc/rc.d/ntpd stop
> 	/etc/rc.d/dhcpcd stop
> 	/etc/rc.d/network stop
> 	/etc/rc.d/wpa_supplicant stop
> 
> 	/sbin/sysctl -w hw.acpi.sleep.state=3
21a29,37
>     	/etc/rc.d/wpa_supplicant start
> 	/etc/rc.d/network start
> 	/etc/rc.d/dhcpcd start
> 	/etc/rc.d/ntpdate start
> 	/etc/rc.d/ntpd start
> 	/etc/rc.d/bluetooth start
> 
> 	/sbin/sysctl -w hw.acpi.sleep.state=0
> 
root:shrimpy /etc/powerd/scripts>>
--snip--



>How-To-Repeat:

>Fix:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.