File: README

package info (click to toggle)
hibernate 1.07-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 316 kB
  • ctags: 52
  • sloc: sh: 1,014; makefile: 33
file content (138 lines) | stat: -rw-r--r-- 5,569 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
This package contains a new hibernate script, designed for Software Suspend 2.

(This README has been slightly altered so that it accurately reflects
the changes made in the Debian-packaged version of the script.)

PREREQUISITES
-------------
You will require a kernel patched with Software Suspend 2 to use this script.
Patches are available from http://softwaresuspend.berlios.de/

INSTALLATION
------------

This Debian package installs the following files and directories:

/usr/sbin/hibernate                    <--- main executable script
/etc/hibernate/
/etc/hibernate/hibernate.conf          <--- main configuration file
/etc/hibernate/scriptlets.d/           <--- for custom scriptlets
/usr/share/hibernate/scriptlets.d/     <--- contains "scriptlets" (or plugins)
  various scriptlets live in /usr/share/hibernate/scriptlets.d/

The Debian version of the suspend script installs the standard
scriptlets in /usr/share/hibernate/scriptlets.d, but also looks in
/etc/hibernate/scriptlets.d and /usr/local/share/hibernate/scriptlets.d
for any custom scriptlets that you may want to write.  Documentation
on writing scriptlets can be found in /usr/share/doc/hibernate/SCRIPTLET-API.gz.

AVOIDING DATA LOSS
------------------

If you are using the hibernate script with vanilla swsusp or Software Suspend
2, then it is strongly recommended that you install the script
init.d/hibernate-cleanup.sh into /etc/init.d (or the relevant place on your
distribution), and arrange for it to be run on boot from rcS.d, somewhere
before enabling swap or clearing out /var/run, but after mounting your
filesystems (/var in particular).

This script will invalidate any suspend image on a clean boot so that the image
cannot be later resumed from (leading to corruption of your filesystems).

CONFIGURATION
-------------

The default configuration does nothing but save and restore your clock, and
unload some modules that will potentially cause suspending to fail. If you have
other kernel modules that need to be unloaded, filesystems unmounted, network
interfaces brought down, etc, you will want to customise the configuration file
in /etc/hibernate/hibernate.conf. Run hibernate -h for help on the possible
options. There is also a man page for hibernate.conf as well as hibernate
itself.

RUNNING
-------
Simply calling "hibernate" as root will do everything mentioned in the
configuration file to hibernate, and activate Software Suspend. Upon resuming,
any tasks for resuming the machine are run and the script exits.

If you want users other than root to be able to run the script, check out the
sudo package.

CALLING FROM ACPID
------------------
You may wish to call this script from acpid to allow you to press a button on
your machine to hibernate, or to activate it on lid closure. For example, you
could modify /etc/acpi/events/powerbtn to run hibernate when you press the
power button, as follows:

  event=button[ /]power PWRF
  action=/usr/local/sbin/hibernate

You can watch ACPI events as they occur by running acpi_listen. If you find that
your machine is hibernating twice, you are probably receiving two events for
each button press. To only trigger on one, you may need to use the line

  event=button[ /]power PWRF.*[02468ace]$

to match only every second event. However, for non-button events (such as
triggering on lid closure), it may be more reliable to check the state of the
lid before suspending. For example, a small script called /etc/acpi/lid.sh :

  #!/bin/sh
  #
  # Initiate suspend when lid is closed

  if grep -q closed /proc/acpi/button/lid/$2/state ; then
      /usr/local/sbin/hibernate
  fi

and in /etc/acpi/events/lid

  event=button[ /]lid
  action=/etc/acpi/lid.sh %e

will trigger only when the lid is closed.

For more details, man acpid. For debugging look into /var/log/acpid.

HELP
----
If you have problems with the hibernate script or Software Suspend, the best
place to ask is on the mailing list - suspend2-users@lists.suspend2.net.  You
will need to subscribe to post. See http://www.suspend2.net/lists for details.

If the suspend process itself crashes (while "Writing caches", "Reading
caches", or "Copying original kernel back", etc), then the problem lies with
Software Suspend 2 itself. See the FAQ at http://www.suspend2.net/ for help on
debugging.

AUTHOR
------
This script was written by Bernard Blackham, with contributions from:
 - Carsten Rietzschel (modules, devices, bootsplash, lock and grub scriptlets.
   many ideas and bugfixes)
 - Cameron Patrick (sysfs_power_state, xscreensaver support for lock, many
   bugfixes and ideas, man pages and Debian packaging)
 - Kevin Fenzi (rpm packaging, ideas)
 - Fedor Karpelevitch (lilo scriptlet idea)
 - And many others (see changelog for full credits)

LICENSE
-------
Copyright (C) 2004 Bernard Blackham <bernard@blackham.com.au>

The hibernate-script package is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program.  If not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA.

$Id: README 883 2005-04-21 13:15:23Z bernard $