From owner-freebsd-hackers@freebsd.org Wed Jan 1 22:01:24 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF23A1E1A8F for ; Wed, 1 Jan 2020 22:01:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47p4r33s3Gz4QjP for ; Wed, 1 Jan 2020 22:01:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82d.google.com with SMTP id t3so33602338qtr.11 for ; Wed, 01 Jan 2020 14:01:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W7o/QjJuX4tdJW5KvYq7kuvizFLmYLhD7OeYkYDSUqc=; b=ZI+a8+d0oqKmCIeqseyI34C7wYnEAqchOF7s70HDTOk9gPv59EgUrxU+uNx6xNTDGi vzSjdmlllk5zFq38QCWk94yBZzIVTE0N6ezI6JJCwtreOA0cmDmwHM0avThD926C4+4P HQEt0+ZgJm8KmVGuAurSJ/k5STAKWzijuWXnElZuP1UwbboINj7vDM7X7HZTq9LsXFNa j27wIfeABnLqejFhVqECbgp4JTd9E7/X204mFvJF7iKOBOBDEoxBQea7IrBp3dX4+C7U ujrqvvriDrKVft60wv43I3ifRduLz/FVxFvHUUtUxDmXtPWUtepmB1SeBUBU4w+9T0Zk Sqtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W7o/QjJuX4tdJW5KvYq7kuvizFLmYLhD7OeYkYDSUqc=; b=sg5IPLrGVjHJYznp+pP5t7WKKclGQEztDIF1ofGJoCFtihGJecUnSx4qlQjnnAUXTm pgr3urXLMoqfERzsdd1oxrQki3Ljggiki76Z1pL25gCpecbVyWnVc/Ocxd9y4/0vliOf pY/Tz6Jgg3EIaDnEnfJl9wanix0t6zBBExrzmfPIVhibeLxT1hLIVyZzfyw6hcOqV7JE ZL38G4pmG4Mg6aqROdeSfKiUa/gaKSdr0zfb8u5sKjlE3ugS9YAzxgEsD2j0jV41DGsC GlcYRtax2XGzM7B3WJYrBLwjO5LZTe0szDdsW9k0FZ7vJ8KdDiXOhliDyhrEpsSSXfIk RE+Q== X-Gm-Message-State: APjAAAW3K5RyOJcSL9agG8SdbsIZyI5xU3T0s6XKxfyHokHFGmuDR9ok DMWJfC4/S/c2a6H61+kclUw1RTWdKzM12wwtqDnhjA== X-Google-Smtp-Source: APXvYqyTd81Zspspz/QKDlDfJd84RRJJ0s7XfOPcsWcwt0BgvvLLiJs2ePhuG8Uf6c+sqRCaPoV0d4DYHMfLTgxIuMk= X-Received: by 2002:aed:3b79:: with SMTP id q54mr47602057qte.187.1577916082324; Wed, 01 Jan 2020 14:01:22 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Wed, 1 Jan 2020 15:01:11 -0700 Message-ID: Subject: Re: How do I completely disable suspend? To: Ryan Stone Cc: FreeBSD Hackers X-Rspamd-Queue-Id: 47p4r33s3Gz4QjP X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=ZI+a8+d0; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::82d) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.68 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; IP_SCORE(-2.68)[ip: (-9.32), ipnet: 2607:f8b0::/32(-2.15), asn: 15169(-1.87), country: US(-0.05)]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[d.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jan 2020 22:01:25 -0000 On Wed, Jan 1, 2020, 1:46 PM Ryan Stone wrote: > I have a laptop on which suspend/resume doesn't work. I don't need > suspend/resume and don't want to spend the time debugging it. > However, there are some really annoying cases that can trigger a > suspend, and I find up having to power off the laptop to get it to > boot properly again. How can I completely disable suspend? Playing > with the sysctls under hw.acpi doesn't seem to actually do anything. > You want to make the switch action do nothing. I do this so that I have a custom devd action that sleeps for 60 seconds and then suspends if the lid is still closed. I often close my lid and then go 'oh, crap I forgot to...' and I want some time to recover from that mistake that doesn't force a suspend/resume. hw.acpi.lid_switch_state: NONE and notify 10 { match "system" "ACPI"; match "subsystem" "Lid"; action "/usr/local/bin/imp-lid $notify"; }; in devd.conf for me. And while Ryan won't need it, here's imp-lid: #!/bin/sh lid-wait() { logger "Waiting a minute to suspend" sleep 60 case $(sysctl -n dev.acpi_lid.0.state) in 0) logger "suspending"; zzz ;; *) logger "never mind";; esac } case $1 in 0x00) # lid closed lid-wait & ;; 0x01) ;; # Ignore opening esac exit 0 Warner _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >