From: Neil Bothwick <neil@digimed.co.uk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] hibernate... /bin/echo: write error: No such device
Date: Thu, 4 Aug 2022 00:17:03 +0100 [thread overview]
Message-ID: <20220804001703.5f5581e8@digimed.co.uk> (raw)
In-Reply-To: <YurpDqSUN3h9cRHh@waltdnes.org>
[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]
On Wed, 3 Aug 2022 17:30:54 -0400, Walter Dnes wrote:
> Next we look at file
> /usr/share/hibernate/scriptlets.d/sysfs_power_state which has a short
> function DoSysfsPowerStateSuspend(). Anyone remember ye old dayes of
> FORTRAN, where you'd throw in print statements to debug errors? I've
> added a few debug statements, like so...
>
> DoSysfsPowerStateSuspend() {
> if [ -z "$SYSFS_POWER_STATE_NO_SUSPEND" ] ; then
> vecho 1 "$EXE: Activating sysfs power state
> $USING_SYSFS_POWER_STATE ..." echo "1 ==> $USING_SYSFS_POWER_STATE"
> echo "2 ==> $SYSFS_POWER_STATE_POWERDOWN_METHOD"
> echo "3 ==> $SYSFS_POWERDOWN_METHOD_FILE"
> echo "4 ==> $SYSFS_POWER_STATE_FILE"
> [ -n "$SYSFS_POWER_STATE_POWERDOWN_METHOD" ] && \
> [ -f "$SYSFS_POWERDOWN_METHOD_FILE" ] && \
> /bin/echo $SYSFS_POWER_STATE_POWERDOWN_METHOD >
> $SYSFS_POWERDOWN_METHOD_FILE /bin/echo -n $USING_SYSFS_POWER_STATE >
> $SYSFS_POWER_STATE_FILE else
> vecho 1 "$EXE: Not actually suspending (--no-suspend given)"
> fi
> return 0
> }
>
> The output from hibernate is...
>
> 1 ==> disk
> 2 ==>
> 3 ==> /sys/power/disk
> 4 ==> /sys/power/state
> /bin/echo: write error: No such device
Which call to /bin/echo is failing? Instead of filling the script with
echo statements, add "set -x" near the top, then it will output each line
before executing it. That way you will not only see which echo call has
failed, but you will also see the values of the environments variables in
the call.
--
Neil Bothwick
Nothing is foolproof to a sufficiently talented fool.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-08-03 23:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-27 21:53 [gentoo-user] hibernate... /bin/echo: write error: No such device Walter Dnes
2022-07-27 22:57 ` Adam Carter
2022-07-27 23:40 ` Walter Dnes
2022-07-27 23:42 ` Neil Bothwick
2022-08-01 10:02 ` J. Roeleveld
2022-08-03 21:30 ` Walter Dnes
2022-08-03 22:59 ` Jack
2022-08-03 23:17 ` Neil Bothwick [this message]
2022-10-12 3:13 ` [gentoo-user] Re: [SOLVED] " Walter Dnes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220804001703.5f5581e8@digimed.co.uk \
--to=neil@digimed.co.uk \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox