I usually keep my desktop running all the time, but
the utility
bills are getting to me. I would like it to shutdown when I'm not here,
and restart quickly.
Hibernate
My requirementsConfiguration
Implementation Steps for 2.6.10_rc3
Upgrade to 2.6.11.6
Current Status
Using it
/etc/hibernate/suspend2.confWorking with HAL
/etc/hibernate/common.conf
/usr/share/hal/scripts/hal-system-power-suspend
/usr/share/hal/scripts/hal-system-power-hibernate
/etc/hal/hal-system-power-suspend
/etc/hal/hal-system-power-hibernate
"Suspend" means "Suspend to RAM" (STR) which means the entire running system is paused. System memory (RAM) contains the current system state, and is kept powered on. Screen, disks, and processor are powered off.
"Hibernate" means "Suspend to Disk" (STD) which means the entire running system is paused, saved in non-volatile storage (hard disk) and the system is powered off. On restoring power, the system does not boot normally and instead restores the previously saved state. Laptops do this. I want my desktop to do it, too.
See:
UseSwsusp2 yes
Reboot no
EnableEscape yes
DefaultConsoleLevel 1
Compressor lzf
Encryptor none
ImageSizeLimit 200
SuspendDevice swap:/dev/hda3
PowerdownMethod 5
ProcSetting userui_program /sbin/suspend2ui_text
FullSpeedCPU yes
Verbosity 0
LogFile /var/log/hibernate.log
LogVerbosity 4
Distribution gentoo
SaveClock restore-only
UnmountFSTypes smbfs nfs
ChangeGrubMenu yes
# Use LoadModules to control load order.
UnloadModules tuner cx88xx snd_mixer_oss uhci-hcd ehci-hcd
UnloadBlacklistedModules yes
LoadModules snd_mixer_oss cx8800 tuner huci-hcd ehci-hcd
GentooModulesAutoload yes
RestartServices hotplug alsasound vixie-cron smartd hdparm
SwitchToTextMode yes
XStatus gnome
HAL = Hardware Abstraction Layer. It's used by Gnome to better organize the software project. Gnome asks HAL to suspend or hibernate, and HAL knows how. The problem is that HAL may get it wrong on systems with suspend2. These changes get it working.
These changes are for HAL 0.5.7. Following versions do things differently.
read seconds_to_sleep
#This one overrides them all.
if [ -x "/etc/hal/hal-system-power-suspend" ]; then
/etc/hal/hal-system-power-suspend
RET=$?
#SuSE and ALTLinux only support powersave
elif [ -f "/etc/altlinux-release" ] || [ -f "/etc/SuSE-release" ] ; then
#This one overrides them all.
if [ -x "/etc/hal/hal-system-power-hibernate" ]; then
/etc/hal/hal-system-power-hibernate
RET=$?
#SuSE and ALTLinux only support powersave
elif [ -f /etc/altlinux-release ] || [ -f "/etc/SuSE-release" ] ; then
#!/bin/sh
# Suspend method for hal.
# See /etc/hal/scripts/hal-system-power-suspend
# That script is modified to check for this one first.
# Shut down VPN. Can't restore without password.
if ifconfig tun0 &> /dev/null; then
vpnc-disconnect
fi
# Shut down DSL.
# Do not restart on resume: something is not quite ready and network gets in bad state.
if ifconfig ppp0 &> /dev/null; then
/etc/firestarter/firestarter.sh stop
/etc/init.d/net.ppp0 stop
fi
# Suspend now
/usr/sbin/hibernate-ram --force
STATUS=$?
exit $STATUS
#!/bin/sh
# Hibernate method for hal.
# See /etc/hal/scripts/hal-system-power-hibernate
# That script is modified to check for this one first.
# Shut down VPN. Can't restore without password.
if ifconfig tun0 &> /dev/null; then
vpnc-disconnect
fi
# Shut down DSL.
# Do not restart on resume: something is not quite ready and network gets in bad state.
if ifconfig ppp0 &> /dev/null; then
/etc/firestarter/firestarter.sh stop
/etc/init.d/net.ppp0 stop
fi
# Hibernate now
/usr/sbin/hibernate --force --kill
STATUS=$?
exit $STATUS
| Copyright © 2004-2007 Craig Lawson | ||
| Index | ![]() |