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: pgptwQrkeZTPB.pgp
Description: OpenPGP digital signature

Reply via email to