Up to date suspend script?
Up to date suspend script?
I'm using an old eeepc netbook hooked up to a hi-fi system purely as a music player. It's currently running Bodhi Linux (installed) but I'd prefer to use Puppy (of course!). It's set up as a 'turn-key' system - it's never powered down but spends most of it's time in 'suspend' where it uses almost no power and is ready to use straight away (I don't want to wait for a boot up when I just want 10 minutes of music while doing the dishes )
Can I achieve something like this in Puppy? As it's in RAM I suppose only a partial 'power down' is possible...?
I'm not certain what suspend/hibernate etc actually do but what I'd like to achieve is:
- Blank the screen to protect it
- Use the minimum amount of power
- Be ready to use instantly
I've looked at the threads here on this subject but none seem very recent so any help would be appreciated. Latest 'Precise' would be the version of choice
Paul
Can I achieve something like this in Puppy? As it's in RAM I suppose only a partial 'power down' is possible...?
I'm not certain what suspend/hibernate etc actually do but what I'd like to achieve is:
- Blank the screen to protect it
- Use the minimum amount of power
- Be ready to use instantly
I've looked at the threads here on this subject but none seem very recent so any help would be appreciated. Latest 'Precise' would be the version of choice
Paul
- Blank the screen to protect it
Code: Select all
pupx
Screensaver/Screen Blanking do not protect the screen , they protect the user's eyes .
[suspend/
Code: Select all
acpitool -s
Otherwise we all are eager here to be told by you how Bodhi does it
ie closing lid blahblah ..
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Thanks for those Karl.
Maybe I meant 'power off the screen'? I just want it to use as little power as possible and not burn pixels onto the screen, my eyes can look after themselves
So, what does 'acpitool -s' do exactly?
Closing the lid would be one more bit of hassle I press the power on button to resume from the suspended state and choose logout->suspend to suspend. Not very exciting I'm afraid
Maybe I meant 'power off the screen'? I just want it to use as little power as possible and not burn pixels onto the screen, my eyes can look after themselves
So, what does 'acpitool -s' do exactly?
Closing the lid would be one more bit of hassle I press the power on button to resume from the suspended state and choose logout->suspend to suspend. Not very exciting I'm afraid
Thanks! How do you wake it up again?MochiMoppel wrote:Precise is the first puppy which doesn't pose any problems for me with suspend.This script works for me:#!/bin/sh
Xdialog --timeout 5 --no-close --title "$0" --yesno "\n\nSuspend session?\n\n(Defaults to YES after 5 sec)" 0 0
[ $? != 1 ] && sync && echo -n mem > /sys/power/state
Paul
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
On my EEEPC machine it is the SPACE BAR to wake it up , on my KeyboardPC the Power Button .
ACPITOOL you could find several versions in the additional software section , one by me with glibc-2.10.x and above (racy) .
man acpitool should give you a manual page, except if bloodhi has omitted them to reduce size .
As I had read Buddahi uses enlightenment WM; runtt21 unfortunately had hacked out the e17 logout interface witch had the suspend and resume buttons in recent macpups - but i read from him somewhere years ago there are configuration files in .etc/enlightenment .
/etc/acpi is the dir to look for suspend scripts - otherwise .
ACPITOOL you could find several versions in the additional software section , one by me with glibc-2.10.x and above (racy) .
man acpitool should give you a manual page, except if bloodhi has omitted them to reduce size .
As I had read Buddahi uses enlightenment WM; runtt21 unfortunately had hacked out the e17 logout interface witch had the suspend and resume buttons in recent macpups - but i read from him somewhere years ago there are configuration files in .etc/enlightenment .
/etc/acpi is the dir to look for suspend scripts - otherwise .
MochiMoppel's script works great for me but I'd like to remove the confirmation dialog. As I'm not familiar with shell scripting syntax would I be right in thinking I could just use a script as follows:
As expected (!) I get a nasty result if I suspend while music is playing but that's no biggie.
Code: Select all
#!bin/sh
sync
echo -n mem > /sys/power/state
You can add a lot of things there before finally echoing mem into sys power state ,
like wmexit or a bunch of lines from rc.shutdown to close internet connection , stop drivers by rmmod ing them , stop /etc/init.d/daemons , udevd, klogd, syslogd , pup_event_frontend_d or unmount partitions and such ..
A working acpid daemon could possibly have a relauch part then in /etc/acpi .
About sync :
When there is some read-only partition mounted, sync might hang the script and the lines afterwards might not get executed .
like wmexit or a bunch of lines from rc.shutdown to close internet connection , stop drivers by rmmod ing them , stop /etc/init.d/daemons , udevd, klogd, syslogd , pup_event_frontend_d or unmount partitions and such ..
A working acpid daemon could possibly have a relauch part then in /etc/acpi .
About sync :
When there is some read-only partition mounted, sync might hang the script and the lines afterwards might not get executed .
-
- Posts: 210
- Joined: Thu 18 Nov 2010, 05:39
- Location: The Island Of Long (NY, USA)
The Fatdog suspend script might work for you.
I have seen a few threads that are similar with people having trouble with laptops. This might be more than you are looking for Paul: It would require closing and opening the lid and pushing a button. This might help someone else better.
I think the suspend scripts work on multiple puppies. My Slacko suspend script was copied from Fatdog. I was running Slacko on my Gateway netbook and it would not wake up when I opened the lid no matter what buttons I pushed. When I ran Fatdog64, the suspend script worked.
What I did was copy the Fatdog script and Slacko wakes up the same.
The scripts are located at /etc/acpi/actions
Here is the Fatdog script:
Here is the Slacko script (which did not work on my netbook)
After looking at this again, Slacko doesn't have the WPA Gui so the Fatdog script doesn't get the internet up automatically in Slacko.
I wonder if other people using Fatdog had to get scripts from elsewhere to get their laptops/netbooks to work properly or if the Fatdog script is better?
I think the suspend scripts work on multiple puppies. My Slacko suspend script was copied from Fatdog. I was running Slacko on my Gateway netbook and it would not wake up when I opened the lid no matter what buttons I pushed. When I ran Fatdog64, the suspend script worked.
What I did was copy the Fatdog script and Slacko wakes up the same.
The scripts are located at /etc/acpi/actions
Here is the Fatdog script:
Code: Select all
#!/bin/sh
# suspend.sh 28sep09 by shinobar
# do not suspend at shutdown proccess
if [ "$(cat /proc/acpi/button/lid/*/state | grep open)" != "" ] ; then
exit
fi
for P in acpi_poweroff.sh
do
ps ax | grep -v 'grep' | grep -q "sh[ ].*$P" && exit
done
for P in wmpoweroff poweroff
do
pidof "$P" >/dev/null && exit
done
# unmount if usb media mounted
USBS=$( mount | grep $(probedisk2|grep '|usb' | cut -d'|' -f1) | cut -d " " -f 1 | sed 's/dev/mnt/' )
for USB in $USBS
do
fuser -mk $USB
umount $USB
done
# process before suspend
# sync for non-usb drives
sync
rmmod ehci_hcd
#suspend
/etc/rc.d/rc.network stop
kill -9 $(pidof wpa_cli)
killall dhcpcd-wpagui
killall dhcpcd
killall wpa_supplicant
echo mem > /sys/power/state
# process at recovery from suspend
modprobe ehci_hcd
/etc/rc.d/rc.network
/etc/init.d/50-Wpagui start
Here is the Slacko script (which did not work on my netbook)
Code: Select all
#!/bin/sh
# suspend.sh 28sep09 by shinobar
# do not suspend at shutdown proccess
#111129 added suspend to acpi_poweroff.sh
if [ ! -f /tmp/suspend ];then
for P in acpi_poweroff.sh
do
ps ax | grep -v 'grep' | grep -q "sh[ ].*$P" && exit
done
fi
rm -f /tmp/suspend
for P in wmpoweroff poweroff
do
pidof "$P" >/dev/null && exit
done
# do not suspend if usb media mounted
USBS=$(probedisk2|grep '|usb' | cut -d'|' -f1 )
for USB in $USBS
do
mount | grep -q "^$USB" && exit
done
# process before suspend
# sync for non-usb drives
sync
rmmod ehci_hcd
#suspend
echo -n mem > /sys/power/state
# process at recovery from suspend
modprobe ehci_hcd
After looking at this again, Slacko doesn't have the WPA Gui so the Fatdog script doesn't get the internet up automatically in Slacko.
I wonder if other people using Fatdog had to get scripts from elsewhere to get their laptops/netbooks to work properly or if the Fatdog script is better?
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Simple? - yes. Great? - not really. I sometimes have to restart internet connection after wakeup, but otherwise I'm pretty happy with it.PaulR wrote:Mopimoppel's simple script is working great
I remember that I once fiddled with acpitool, but had issues. I also tried the Fatdog script: After wakeup my desktop was lost and my boot partition unmounted . I'm sure it works on some hardware, but it doesn't on mine.
-
- Posts: 210
- Joined: Thu 18 Nov 2010, 05:39
- Location: The Island Of Long (NY, USA)
I don't understand most of the scripts and exactly how they work but once I saw that the Fatdog script worked, I figured it wouldn't hurt to try it on Slacko after learning from here where the scripts are located.
It might not hurt if other puppy's scripts were pasted here so people having trouble could try copying them to their etc/acpi/actions directories.
To get internet working in Slacko after waking up, I changed the last line from the Fatdog script and I think the second to last line is needed too.
Since I am using frisbee, the last line is:
Instead of:
It seems like it takes a little longer for my internet connection to get back up and running with frisbee.
It might not hurt if other puppy's scripts were pasted here so people having trouble could try copying them to their etc/acpi/actions directories.
To get internet working in Slacko after waking up, I changed the last line from the Fatdog script and I think the second to last line is needed too.
Since I am using frisbee, the last line is:
Code: Select all
/etc/init.d/frisbee start
Code: Select all
/etc/init.d/50-Wpagui start
-
- Posts: 210
- Joined: Thu 18 Nov 2010, 05:39
- Location: The Island Of Long (NY, USA)
Found this:
http://puppylinux.info/topic/automatic-standby
Remember this one, Karl?
Hope this helps.
http://puppylinux.info/topic/automatic-standby
Remember this one, Karl?
Hope this helps.
good stuff, be sure to run from RAM and in some hardware like mine, the USB powers off as well, which causes havoc if running with a savefile on a USB. Music files are small, so copy them as well, a multisession Cd/DVD would work well, or if 64bit multisession fatdogs way with USB, it load into RAM and saves back at the end, so USB disconnection will not cause a issue.