From nobody Thu Aug 31 18:42:14 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rc94r2bBPz4rT63 for ; Thu, 31 Aug 2023 18:42:20 +0000 (UTC) (envelope-from grahamperrin@gmail.com) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rc94q1rGqz4Xrx for ; Thu, 31 Aug 2023 18:42:19 +0000 (UTC) (envelope-from grahamperrin@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20221208 header.b=euq+6lJG; spf=pass (mx1.freebsd.org: domain of grahamperrin@gmail.com designates 2a00:1450:4864:20::536 as permitted sender) smtp.mailfrom=grahamperrin@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-52bd9ddb741so1587183a12.0 for ; Thu, 31 Aug 2023 11:42:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693507337; x=1694112137; darn=freebsd.org; h=content-transfer-encoding:subject:from:content-language:to :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=K4W8byYj8h4tgXN+GW+ahSLXXCb45tur8Ik9ALTuga4=; b=euq+6lJGrSFmZLX/rRRmMIW3lEJaQxztX7AW8XDlz4ZVulAYiRQh+bstoSFw6EkYX1 NDjacgbbI/eNaSHJQK7H2YE4D7mDUp4OL2y4cAo3aAD5j49AO2M13939vblFDPNNeU8r zYrec0Hj/5QvFRj/ydXW5g0QAnJc2v47zNh63QVuuuUpHiSBOG6Pr1PvfIiulBBOW7sh S3QIJ01Ww1Jng2lHoZVRY08yEW8H34xmv4T0Wbu4m4UOwdsMeH27s4iolGcGDeMp76Dl ba4faN2VeUA8+NKKk1HTW/4kEI2SzAo6YBDBoNIg5I22bEj/j62N5PXx4ZsPGEyjWip1 PBLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693507337; x=1694112137; h=content-transfer-encoding:subject:from:content-language:to :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=K4W8byYj8h4tgXN+GW+ahSLXXCb45tur8Ik9ALTuga4=; b=SQ9uplpsmyD/wFkhuEkkMfv6Au77+g526j82OarUF5tZVc8MelN6/DPpUOujX590EG HNgNJ2AU/pWRCxfGOab5ZBbE4Zk6tq28ASDEeTV165kYO32iaPrwcIzivolVzP0twp91 GIxtZF7I5eHDKQef4P7cTA1PUzOjlPPSVeqtannufauuccdFEJDXGfg13vba6kts99s4 IvBFX4nbcD3xFrr1/dcPoE+lUDJ+5g19fmYb3RJxbRBArDOqE60mwmJu+Aak077KKmKd PaefS1xRRKtR94sxBVTU3fFmAXGO41gqvo0cixi9cmsQtibqN5Uxk4V5Jl/KjY0Bw/LD Nsew== X-Gm-Message-State: AOJu0YwjM3PcLkzUkPX4ViqfWTbxo+ataPBCZZjsC4MFBmBGoEpYBqz9 wPzQm95km5l0g7TvZ0eNeduX5mwQ/gPRXQ== X-Google-Smtp-Source: AGHT+IHYA9cY8a5kZk4AgXnLTGYlvIJpxr9QE2i9vmf05OcyhCc61SKEvWHvIU7bNFTKKfdJMf7FbA== X-Received: by 2002:a17:907:a0c6:b0:9a2:26d8:f184 with SMTP id hw6-20020a170907a0c600b009a226d8f184mr112331ejc.51.1693507337142; Thu, 31 Aug 2023 11:42:17 -0700 (PDT) Received: from [192.168.1.10] (80-42-66-93.dynamic.dsl.as9105.com. [80.42.66.93]) by smtp.gmail.com with ESMTPSA id lg11-20020a170906f88b00b00997d7aa59fasm1055610ejb.14.2023.08.31.11.42.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 31 Aug 2023 11:42:16 -0700 (PDT) Message-ID: <5a642c3d-6b32-4614-ad7d-40f72b92e537@gmail.com> Date: Thu, 31 Aug 2023 19:42:14 +0100 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 To: FreeBSD CURRENT Content-Language: en-US From: Graham Perrin Subject: Occasional supend/sleep failure Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Bar: --- X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.996]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20221208]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[grahamperrin]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::536:from]; ARC_NA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; TO_DN_ALL(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4Rc94q1rGqz4Xrx I have a suspend.sh script that aims to take three cache devices offline before sleep of the computer: % grep -v -e '# ' /etc/rc.suspend | uniq | grep -B 3 -A 2 suspend.sh #!/bin/sh # /usr/local/sbin/suspend.sh         echo "Usage: $0 [apm|acpi] [standby,suspend|1-4]" % grep -v -e '# ' /usr/local/sbin/suspend.sh | uniq #!/bin/sh while mount | grep Transcend 2>&1; do    zpool export Transcend    sleep 5 done zpool offline august gpt/cache1-august zpool offline august gpt/cache2-august zpool offline august gpt/cache3-august sync killall pulseaudio while fstat | grep -e dsp -e mixer 2>&1; do    fstat | grep -e dsp -e mixer | cut -w -f 3 | while read pid;       do kill -15 "$pid"    done done sysctl hw.snd.default_unit=1 % Below, it seems that sleep fails if a device is not detached. (Possibly if the offlining does not succeed, although I did check pool status shortly before suspend.) How can I more reliably ensure detachment before /etc/rc.suspend proceeds? Alternatively (ideally) is it possible for /etc/rc.suspend to _not_ proceed if detachment does not occur? Final lines in /var/log/messages before a forced stop of the computer: Aug 31 17:37:01 mowa219-gjp4-8570p-freebsd kernel: ugen1.8: at usbus1 (disconnected) Aug 31 17:38:46 mowa219-gjp4-8570p-freebsd kernel: vdev_geom_close_locked:352[1]: Closing access to gpt/cache1-august. Aug 31 17:38:46 mowa219-gjp4-8570p-freebsd kernel: vdev_geom_detach:315[1]: Detaching from gpt/cache1-august. Aug 31 17:38:46 mowa219-gjp4-8570p-freebsd kernel: vdev_geom_detach:326[1]: Destroying consumer for gpt/cache1-august. Aug 31 17:38:53 mowa219-gjp4-8570p-freebsd kernel: acpi0: suspend request timed out, forcing sleep now Aug 31 17:38:56 mowa219-gjp4-8570p-freebsd kernel: vdev_geom_close_locked:352[1]: Closing access to gpt/cache2-august. Aug 31 17:38:56 mowa219-gjp4-8570p-freebsd kernel: vdev_geom_detach:315[1]: Detaching from gpt/cache2-august. Aug 31 17:38:56 mowa219-gjp4-8570p-freebsd kernel: vdev_geom_detach:326[1]: Destroying consumer for gpt/cache2-august. Extract from /var/log/console.log after the next start: Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: Enter full pathname of shell or RETURN for /bin/sh: Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: # mount -uw / Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: # zfs mount -a Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: # zpool status -x Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel:   pool: august Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel:  state: ONLINE Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: status: One or more devices has been taken offline by the administrator. Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel:      Sufficient replicas exist for the pool to continue functioning in a Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel:      degraded state. Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: action: Online the device using 'zpool online' or replace the device with Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel:      'zpool replace'. Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel:   scan: scrub repaired 0B in 11:06:38 with 0 errors on Mon Jun 12 01:56:37 2023 Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: config: Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: NAME                 STATE     READ WRITE CKSUM Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: august               ONLINE       0     0     0 Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: ada0p3.eli         ONLINE       0     0     0 Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel:      cache Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: gpt/cache2-august  OFFLINE      0     0     0 Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: gpt/cache3-august  ONLINE       0     0     0 Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: gpt/cache1-august  OFFLINE      0     0     0 Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: Aug 31 18:29:26 mowa219-gjp4-8570p-freebsd kernel: errors: No known data errors