Looking For A Suspend That Suits ArtfulPup.(SOLVED)

Booting, installing, newbie
Post Reply
Message
Author
BJF
Posts: 262
Joined: Tue 25 Mar 2008, 02:23
Location: Lower Hutt, New Zealand

#16 Post by BJF »

Sorry, I broke my suspend.sh with copy-and-paste. It has been recovered and the two lidcheck code lines added back where specified at # add.

/temp/lidcheck remains empty and still no suspend.

My current accurately updated /etc/acpi/actions/suspend.sh is here:

Code: Select all

#!/bin/sh
# suspend.sh 28sep09 by shinobar
# 12feb10 pass poweroff
# 23apr12 fix was not suspend from acpi_poweroff.sh
#20140526 shinobar: avoid multiple run
#20140629 shinobar: ACPI_CONFIG
ACPI_CONFIG=/etc/acpi/acpi.conf
[ -s "$ACPI_CONFIG" ] && . "$ACPI_CONFIG"
case "$DISABLE_SUSPEND" in
y*|Y*|true|True|TRUE|1) exit;;
esac

#avoid multiple run
LOCKFILE=/tmp/acpi_suspend-flg
if [ -f "$LOCKFILE" ]; then
  PID=$(cat "$LOCKFILE")
  ps| grep "^[ ]*$PID " && exit
fi
echo -n $$ > "$LOCKFILE"
sync
[ "$(cat "$LOCKFILE")" = $$ ] || exit 0

# do not suspend at shutdown proccess
#111129 added suspend to acpi_poweroff.sh
PS=$(ps)
[ ! -f /tmp/suspend ] && echo "$PS"| grep -qE 'sh[ ].*poweroff' && rm -f "$LOCKFILE" && exit 0
rm -f /tmp/suspend

echo acpi config, multipleruntest, shutdowndisable ok >> /tmp/lidcheck  #add 

# do not suspend if usb media mounted
USBS=$(probedisk2|grep '|usb' | cut -d'|' -f1 )
for USB in $USBS
do
   mount | grep -q "^$USB" && rm -f "$LOCKFILE" && exit 0
done

# process before suspend
# sync for non-usb drives
sync
rmmod ehci_hcd

#suspend
echo -n mem > /sys/power/state

echo sync ok >> /tmp/lidcheck  # add 

# process at recovery from suspend
#restartwm
modprobe ehci_hcd
#/etc/rc.d/rc.network restart

rm -f "$LOCKFILE
Interestingly, there is a mirror of my file above in /etc/acpi/actions/lid/ called 00000080.

With the SD being mounted and read by a USB device (I'll reboot and do ESC to find out how the cardreader is defined, and come back), does that rule out Suspending entirely, or is there a possibility to exclude the Reader by specifying it as an exception to the mounted USB check, or is that ice too thin to skate on? And how does the Command line pull it off, but then is it ducking the USB mount question.

Thanks guys.

EDIT: The netbook sees the cardreader as:

USB:USB2.0 CardReader SD0.

-I'm tempted to comment out the USB mount check in suspend.sh to see what happens!

User avatar
Marv
Posts: 1264
Joined: Wed 04 May 2005, 13:47
Location: SW Wisconsin

#17 Post by Marv »

@BJF PM sent, running an old Artful 17.11 +4 on a USB stick in the Fujitsu S761. Suspending using either of the 'play with fires' I sent you. No short term problems seen, suspended mid-post etc.
Pups currently in kennel :D Older LxPupSc and X-slacko-4.4 for my users; LxPupSc, LxPupSc64 and upupEF for me. All good pups indeed, and all running savefiles for look'n'feel only. Browsers, etc. solely from SFS.

BJF
Posts: 262
Joined: Tue 25 Mar 2008, 02:23
Location: Lower Hutt, New Zealand

#18 Post by BJF »

I'm marking this as SOLVED because I now have my EeePC going into Suspend when the lid is shut, made possible by alterations to the suspend.sh file that cause it to not recognise the SD Cardreader as a USB device and so resist the action. This is NOT to be recommended but works for me on my netbook. I thank those who assisted me with this outcome. Well done

Cheers.

Post Reply