Hi Bart, Thanks for you detailed response. I have started using /etc/acpi/sleep.sh and that works.
I have come up with some changes to the documentation based on your response, I hope it may be of some help. I have attached a file which one might place in /etc/acpi/README (I don't know of any other README files under /etc/, but it seems sensible, doesn't it? Otherwise with some modifications it could go into /usr/share/doc/acpi-support/README.Debian). I have also attached a modified version of /etc/default/acpi-support, along with a patch from the current version on my system. Best wishes, Frederik On Thu, Sep 04, 2008 at 03:58:46PM +0200, Bart Samwel wrote: > Hi Frederik, > > Let me see if I can answer your questions. > > Frederik Eaton wrote: > > I am sorry to be trouble, there is probably an easy solution but I > > couldn't find it after some time, so I am submitting this as a > > documentation bug, hopefully the situation can be improved for future > > users even if my question is addressed. > > > > I just want to turn of my network interfaces on suspend (maybe this > > happens automatically with some desktop environment or using > > /etc/network/interfaces but I don't use those), so I looked around and > > found /etc/acpi/suspend.d/ and put a script in there. It doesn't seem > > to run on suspend, which I do with > > > > acpitool -s > > Ahhhh... acpitool is a low-level tool which runs *nothing* on suspend. > It is not really intended for end user usage, because it doesn't > integrate with the system at all. So that explains it. If you want to > use the suspend method as specified in /etc/default/acpi-support, you > need to run /etc/acpi/sleep.sh. > > The trouble here is that suspend on Linux is an absolute mess. There is > confusion between layers: acpitool is a low-level hardware tool while > acpi-support and pm-utils both deliver a high-level suspend system > integrated with the system. There is no central place to put scripts > (acpi-support and pm-utils both have their own systems for this, and > there are even more suspend systems!). The only way to fix this is for > the various authors to get together and make arrangements. I haven't had > much success cooperating with the pm-utils folks in the past, and the > acpi-support upstream is not too cooperative either. All in all, I've > given up. I've deprecated the acpi-support suspend system in favor of > the pm-utils one so that there's at least *some* semblance of a single > suspend system (especially since gnome-power-manager forces the use of > pm-utils and we like to keep behaviour consistent with that). > > Anyway, I might be able to add some docs, but it's going to remain a > mess whatever I do... > > Cheers, > Bart >
This directory contains configuration files that define various power-related events and control how a laptop is suspended and resumed. The actions defined in /etc/acpi/suspend.d/ and /etc/acpi/resume.d/ are ignored by default, and are deprecated. However, they can be enabled by editing /etc/defaults/acpi-support. To have a custom script executed on suspend, it is recommended to use pm-utils instead (/usr/lib/pm-utils/sleep.d/). Note that acpi-support is bypassed by 'acpitool -s'; to enable the suspend actions defined through acpi-support, one must put a laptop to sleep with '/etc/acpi/sleep.sh'.
# # Configuration file for the acpi-support package # # # The acpi-support package is intended as "glue" to make special functions of # laptops work. Specifically, it translates special function keys for some # laptop models into actions or generic function key presses. # # # Suspend/hibernate method # ------------------------ # # When gnome-power-manager or klaptopdaemon are running, acpi-support will # translate the suspend and hibernate keys of laptops into special "suspend" # and "hibernate" keys that these daemons handle. # # Only in situations where there is no gnome-power-manager or klaptopdaemon # running, acpi-support needs to perform suspend/hibernate in some other way. # There are several options for this. The options are: # # dbus-pm: # Perform suspend and hibernate actions via a DBUS request to the power # management daemon. This works for power management daemons that we don't # know of. (For gnome-power-manager and klaptopdaemon this will do nothing, # since those will be detected when they are running, and triggered using # a virtual keypress.) # # dbus-hal: # Perform suspend and hibernate actions via a DBUS request directly to HAL, # bypassing any running power management daemons. # # pm-utils: # Use pm-suspend and pm-hibernate to suspend and hibernate. (The dbus method # normally results in this as well, but calls through dbus. Use this option # only if you don't have dbus installed.) This runs actions in the directory # /usr/lib/pm-utils/sleep.d/. # # hibernate: # Use the hibernate package to suspend and hibernate. # # acpi-support: # Use the legacy built-in suspend/hibernate support. (DEPRECATED) # This runs actions in the directory '/etc/acpi/suspend.d/' and # '/etc/acpi/resume.d/'. # # none: # Do not attempt to suspend/hibernate. Set SUSPEND_METHODS="none" to # disable suspend/hibernate handling in acpi-support. # # If you specify dbus or pm-utils, the result will normally be the same as when # you suspend from your desktop environment. If you specify "hibernate" or # "acpi-support", be aware that this probably does not match what your desktop # environment would do (unless you have managed to configure something so that # the DBUS power management interfaces call the hibernate package). # # NOTE: none of the suspend/hibernate actions are invoked when a # laptop is put to sleep with 'acpitool -s'. If you do not use Gnome # or KDE and want the following suspend methods to be used, you # should run '/etc/acpi/sleep.sh' instead of using 'acpitool'. # # Please specify a space separated list of options. The recommended value is # "dbus pm-utils" # SUSPEND_METHODS="pm-utils dbus-pm dbus-hal" # # LEGACY BUILT IN SUSPEND SUPPORT (DEPRECATED) # -------------------------------------------- # # These options only work for the "acpi-support" suspend method. This is NOT # recommended, but is retained for backward compatibility reasons. # # Comment the next line to disable ACPI suspend to RAM ACPI_SLEEP=true # Comment the next line to disable suspend to disk ACPI_HIBERNATE=true # Change the following to "standby" to use ACPI S1 sleep, rather than S3. # This will save less power, but may work on more machines ACPI_SLEEP_MODE=mem # Add modules to this list to have them removed before suspend and reloaded # on resume. An example would be MODULES="em8300 yenta_socket" # # Note that network cards and USB controllers will automatically be unloaded # unless they're listed in MODULES_WHITELIST MODULES="" # Add modules to this list to leave them in the kernel over suspend/resume MODULES_WHITELIST="" # Should we save and restore state using the VESA BIOS Extensions? SAVE_VBE_STATE=true # The file that we use to save the vbestate VBESTATE=/var/lib/acpi-support/vbestate # Should we attempt to warm-boot the video hardware on resume? POST_VIDEO=true # Save and restore video state? # SAVE_VIDEO_PCI_STATE=true # Should we switch the screen off with DPMS on suspend? USE_DPMS=true # Use Radeontool to switch the screen off? Seems to be needed on some machines # RADEON_LIGHT=true # Uncomment the next line to switch away from X and back again after resume. # This is needed for some hardware, but should be unnecessary on most. # DOUBLE_CONSOLE_SWITCH=true # Set the following to "platform" if you want to use ACPI to shut down # your machine on hibernation HIBERNATE_MODE=shutdown # Comment this out to disable screen locking on resume LOCK_SCREEN=true # Uncomment this line to have DMA disabled before suspend and reenabled # afterwards # DISABLE_DMA=true # Uncomment this line to attempt to reset the drive on resume. This seems # to be needed for some Sonys # RESET_DRIVE=true # Add services to this list to stop them before suspend and restart them in # the resume process. STOP_SERVICES="" # Restart Infra Red services on resume - off by default as it crashes some # machines RESTART_IRDA=false # Add to this list network interfaces that you don't want to be stopped # during suspend (in fact any network interface whose name starts with # a prefix given in this list is skipped) SKIP_INTERFACES="dummy qemu" # Note: to enable "laptop mode" (to spin down your hard drive for longer # periods of time), install the laptop-mode-tools package and configure # it in /etc/laptop-mode/laptop-mode.conf. # # (Note to upgraders: earlier versions of the acpi-support package contained # an option to enable/disable laptop mode. This option has never actually # worked, and for that reason it has been removed.)
--- acpi-support 2008-09-06 20:16:52.000000000 +0100 +++ acpi-support.revised 2008-09-06 20:09:31.000000000 +0100 @@ -34,13 +34,16 @@ # pm-utils: # Use pm-suspend and pm-hibernate to suspend and hibernate. (The dbus method # normally results in this as well, but calls through dbus. Use this option -# only if you don't have dbus installed.) +# only if you don't have dbus installed.) This runs actions in the directory +# /usr/lib/pm-utils/sleep.d/. # # hibernate: # Use the hibernate package to suspend and hibernate. # # acpi-support: # Use the legacy built-in suspend/hibernate support. (DEPRECATED) +# This runs actions in the directory '/etc/acpi/suspend.d/' and +# '/etc/acpi/resume.d/'. # # none: # Do not attempt to suspend/hibernate. Set SUSPEND_METHODS="none" to @@ -51,7 +54,11 @@ # "acpi-support", be aware that this probably does not match what your desktop # environment would do (unless you have managed to configure something so that # the DBUS power management interfaces call the hibernate package). -# +# +# NOTE: none of the suspend/hibernate actions are invoked when a +# laptop is put to sleep with 'acpitool -s'. If you do not use Gnome +# or KDE and want the following suspend methods to be used, you +# should run '/etc/acpi/sleep.sh' instead of using 'acpitool'. # # Please specify a space separated list of options. The recommended value is # "dbus pm-utils"

