1

The last two nights I have left my computer on overnight and then gone to work when I woke up. When I come home Ubuntu won't wake up and I end up having to hard shutdown and then restart my computer.

I've checked my syslog and see hourly cron reports until some point that it shuts off.

Yesterday:

Oct 19 12:17:01 elite CRON[6507]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Oct 19 19:43:09 elite rsyslogd: [origin software="rsyslogd" swVersion="7.4.4" x-pid="772" x-info="http://www.rsyslog.com"] start

Today:

Most recent hourly Cron report:

Oct 20 14:17:01 elite CRON[13180]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Then:

Oct 20 14:18:28 elite dhclient: DHCPREQUEST of 192.168.1.137 on eth0 to 192.168.1.1 port 67 (xid=0x7daedddb)
Oct 20 14:18:28 elite dhclient: DHCPACK of 192.168.1.137 from 192.168.1.1
Oct 20 14:18:28 elite dhclient: bound to 192.168.1.137 -- renewal in 34922 seconds.
Oct 20 14:18:28 elite NetworkManager[886]: <info> (eth0): DHCPv4 state changed reboot -> renew
Oct 20 14:18:28 elite NetworkManager[886]: <info>   address 192.168.1.137
Oct 20 14:18:28 elite NetworkManager[886]: <info>   prefix 24 (255.255.255.0)
Oct 20 14:18:28 elite NetworkManager[886]: <info>   gateway 192.168.1.1
Oct 20 14:18:28 elite NetworkManager[886]: <info>   hostname 'elite'
Oct 20 14:18:28 elite NetworkManager[886]: <info>   nameserver '192.168.1.1'
Oct 20 14:18:28 elite dbus[762]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
Oct 20 14:18:28 elite dbus[762]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'

Last Hourly Report:

Oct 20 15:17:01 elite CRON[13649]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Startup when I come home:

Oct 20 22:05:15 elite rsyslogd: [origin software="rsyslogd" swVersion="7.4.4" x-pid="760" x-info="http://www.rsyslog.com"] start
Eric Carvalho
  • 55,453

2 Answers2

0

First, save any unsaved work before you start.

Open a terminal and type the following command:

sudo pm-hibernate

The system should hibernate. Now, power the machine back on and if the machine powers back up properly with no issues, you should be able to enable hibernation (disabled by default) with no more issues after long periods of inactivity.

Here's how to enable hibernation.

Open a terminal and execute the following command (you can use any text editor here: gedit, leafpad, mousepad, nano, vim, etc.):

gksu gedit /var/lib/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

and copy/paste the following into the file:

[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes

Save the file and exit. Then, reboot for the changes to take effect.

Click here for more info.

This may help as well.


Now, set up a script to automatically enable hibernation after suspending.

Open the new file with gedit using the following command:

gksu gedit /etc/pm/sleep.d/0000rtchibernate

Copy and paste the following into the contents of the file:

#!/bin/bash
# Script name: /etc/pm/sleep.d/0000rtchibernate
# Purpose: Auto hibernates after a period of sleep
# Edit the "autohibernate" variable below to set the number of seconds to sleep.
curtime=$(date +%s)
autohibernate=3600
echo "$curtime $1" >>/tmp/autohibernate.log
if [ "$1" = "suspend" ]
then
    # Suspending.  Record current time, and set a wake up timer.
    echo "$curtime" >/var/run/pm-utils/locks/rtchibernate.lock
    rtcwake -m no -s $autohibernate
fi

if [ "$1" = "resume" ]
then
    # Coming out of sleep
    sustime=$(cat /var/run/pm-utils/locks/rtchibernate.lock)
    rm /var/run/pm-utils/locks/rtchibernate.lock
    # Did we wake up due to the rtc timer above?
    if [ $(($curtime - $sustime)) -ge $autohibernate ]
    then
        # Then hibernate
        rm /var/run/pm-utils/locks/pm-suspend.lock
        /usr/sbin/pm-hibernate
    else
        # Otherwise cancel the rtc timer and wake up normally.
        rtcwake -m no -s 1
    fi
fi

Save the file before closing gedit.

Next, make the file executable and place a copy into /usr/lib/pm-utils/sleep.d/ with the following two commands:

sudo chmod +x /etc/pm/sleep.d/0000rtchibernate
sudo cp /etc/pm/sleep.d/0000rtchibernate /usr/lib/pm-utils/sleep.d/0000rtchibernate

Reboot for the changes to take effect.

Click here for more info and to check out the source.

mchid
  • 44,904
  • 8
  • 102
  • 162
0

Most obvious answer would be that you have faulty RAM sticks. Try looking in the BIOS for Automatic shutdown/power on settings and make sure they are disabled

Boot Ubuntu from a flash drive, or a CD, and select memory test and let it run and see if you have any errors, if so replace your memory sticks.

Worst case scenario is that your CMOS battery could be malfunctioning.

Xander
  • 1