# system rebooting after hibernate (not powering off) [solved]

## karmaking

After hibernating (pm-hibernate or from KDE-logout), the system does not switch off power, but just reboots and starts up again.

Where can I configure this behaviour? A normal "shut down" will power off the machine just as normal.

Thx & cheers

DanielLast edited by karmaking on Thu Jul 28, 2011 1:38 pm; edited 2 times in total

----------

## karmaking

OK well:

$ emerge --info

Portage 2.1.10.7 (default/linux/amd64/10.0/desktop/kde, gcc-4.4.5, glibc-2.12.2-r0, 2.6.38-gentoo-r6 x86_64)

=================================================================

System uname: Linux-2.6.38-gentoo-r6-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E7300_@_2.66GHz-with-gentoo-2.0.3

Timestamp of tree: Tue, 26 Jul 2011 13:45:01 +0000

ccache version 2.4 [enabled]

app-shells/bash:          4.1_p9

dev-java/java-config:     2.1.11-r3

dev-lang/python:          2.7.1-r1, 3.1.3-r1

dev-util/ccache:          2.4-r9

dev-util/cmake:           2.8.4-r1

dev-util/pkgconfig:       0.26

sys-apps/baselayout:      2.0.3

sys-apps/openrc:          0.8.3-r1

sys-apps/sandbox:         2.4                                                                                              

sys-devel/autoconf:       2.13, 2.68                                                                                       

sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1                                                                         

sys-devel/binutils:       2.20.1-r1                                                                                        

sys-devel/gcc:            4.4.5                                                                                            

sys-devel/gcc-config:     1.4.1-r1                                                                                         

sys-devel/libtool:        2.2.10                                                                                           

sys-devel/make:           3.82                                                                                             

sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)                                                                    

sys-libs/glibc:           2.12.2                                                                                           

Repositories: gentoo                                                                                                       

ACCEPT_KEYWORDS="amd64"                                                                                                    

ACCEPT_LICENSE="* -@EULA AdobeFlash-10.1 googleearth"                                                                      

CBUILD="x86_64-pc-linux-gnu"                                                                                               

CFLAGS="-march=native -O2 -pipe"                                                                                           

CHOST="x86_64-pc-linux-gnu"                                                                                                

CONFIG_PROTECT="/etc /usr/bin/thunderbird /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions/org.freedesktop.udisks.policy /var/lib/hsqldb"                                                                                 

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"

CXXFLAGS="-march=native -O2 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="assume-digests binpkg-logs ccache distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"

FFLAGS=""

GENTOO_MIRRORS="ftp://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/ http://gentoo.mneisen.org/"

LANG="en_US.UTF-8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

LINGUAS="en de"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY=""

SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"

USE="X a52 aac acl acpi alsa amd64 avahi berkdb branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gcj gdbm gdu gif gnutls gpm gtk hddtemp history iconv ipv6 java jpeg kde kipi lcms libnotify mad mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pango pcre pdf perl phonon plasma png policykit ppds pppd python qt3support qt4 readline sdl session spell sse sse2 ssl startup-notification svg sysfs tcpd theora tiff truetype udev unicode usb vim-syntax vorbis x264 xcb xcomposite xinerama xml xorg xscreensaver xulrunner xv xvid zeroconf zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en de" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" SANE_BACKENDS="hp genesys plustek" USERLAND="GNU" VIDEO_CARDS="intel radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

----------

## tomtom69

Hi,

- What is the output of "cat /sys/power/state?"

("mem" should be included if you want to suspend to RAM, "disk" should be included if you want to suspend to disk)

- Is the BIOS configured properly (i.e. ACPI S3 or suspend enabled)?

- What kind of hibernating do you want to use (RAM / disk)?

Tom

----------

## karmaking

- What is the output of "cat /sys/power/state?"

("mem" should be included if you want to suspend to RAM, "disk" should be included if you want to suspend to disk)

standby mem disk

- Is the BIOS configured properly (i.e. ACPI S3 or suspend enabled)?

- What kind of hibernating do you want to use (RAM / disk)?

I'm not using S3, this works fine, though. The problem is with S4, suspend-to-disk (hence pm-hibernate). I couldn't find any options in the BIOS; anyhow the BIOS is not even involved in S4, I assume. I thought it to be a kernel option where you could configure the behaviour after hibernation is completed (power down / cycle)...

----------

## tomtom69

suspend-to-disk needs to know where the disk image is.

In the kernel config you find this here:

- Power management and ACPI options ---> Hibernation

 (needs to be activated)

- Power management and ACPI options ---> Default resume partition 

(insert the partition where the image is stored here. I am using my swap partition for this purpose)

I think ACPI support is also mandatory for suspend-to-disk.

You can see that the kernel created an image in /var/log/messages during hibernation. There should be many messages created, all of them preceeded by "PM:".

For example (one of the most important): "PM: Creating hibernation image:"

What messages do you get in /var/log/messages?

----------

## karmaking

I can hibernate sucessfully. The image is created on pm-hibernate and it is found by the kernel when resuming.

It is only that the PC is not powering off after the image is created, but just starting over, booting and resuming from hibernate. When I cut the power off the box just after the image is written to disk, everything is fine, and I can resume normally later.

I doubt it's a BIOS problem, because when I shut down (without hibernating), it powers off.

----------

## tomtom69

OK, it took me some time to get this  :Wink: 

So next I would look whether ACPI tries to enter S4.

I get in /var/log/messages the lines:

for hibernating:

ACPI: Preparing to enter system sleep state S4

for wakeup:

ACPI: Waking up from system sleep state S4

If you also have these messages I would assume that any wakeup event wakes up the system immediately after entering S4. The BIOS setup usually allows to configure different wakeup events, so try to disable them step by step.

It can also be a BIOS issue - S4 is different from a complete shutdown (afaik because of the wakeup events). Tweaking the settings UseACPISleep, PowerdownMethod, Reboot in /etc/hibernate/common.conf might help (see man hibernate.conf for details of these settings). With these settings you can advise the BIOS to enter complete powerdown instead of S4.

----------

## karmaking

I do not have hibernate-script installed. My config files are in /etc/pm.

Anyhow, I figured it out: In /etc/pm/config.d/ I had to add 

```
HIBERNATE_MODE="shutdown"
```

This overrides the default kernel setting of "platform", which /sys/power/disk told me.

Now the box is powering off after hibernating. Thanks for the hints!

Cheers,

Daniel

----------

