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
  • 54,385
  • I don't even know how to encrypt or unencrypt anything. I have also never changed the swap space. – Unique Depiction Oct 21 '14 at 03:09
  • is this post of any help? http://askubuntu.com/questions/473597/suspend-and-hibernate-not-working-after-updating-ubuntu-14-04-in-amd-processor-l – mchid Oct 21 '14 at 03:16
  • I have no problem coming back from suspension. It just appears that at some point while I'm gone between 6-9 hours after I stop using it, it won't come back. – Unique Depiction Oct 21 '14 at 03:21
  • Is it possible that you've got the screen set to power off after some number of hours, and your video adapter isn't coming back on? I had a problem coming back from hibernation; computer came back but the monitor didn't, so I had to hard reboot so I could see anything. – Marc Oct 21 '14 at 03:38

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
  • 43,546
  • 8
  • 97
  • 150
  • I am able to hibernate but I get this when I try to edit that file: (gedit:13083): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files – Unique Depiction Oct 21 '14 at 04:29
  • @UniqueDepiction sorry, I changed that command and it should work for you now. Don't be suprised if you see some errors opening gedit however as some can be ignored and only have to do with the GTK engine so they have no end effect. Please let me know if it doesn't work. Thanks! – mchid Oct 21 '14 at 04:40
  • 1
    @UniqueDepiction You could use sudo nano instead of sudo gedit. Open with nano, right-click the terminal and select "paste". Then, press CTRL + o to overwrite the file, press ENTER to accept changes to the filename and then use CTRL + x to exit the file when you are done. – mchid Oct 21 '14 at 04:46
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
  • I went to check the bios settings and applied the defaults and exited and now when I startup all I see is a cursor. – Unique Depiction Oct 21 '14 at 04:39
  • @UniqueDepiction try to see which setting was changed and change it back. What BIOS type and version are you running? – mchid Oct 21 '14 at 06:15
  • I gave up and did a fresh install and left my wireless USB adapter in while doing so and I'm pretty sure it wiped it thinking it was a hard drive because it won't install now when I plug it in. I don't know how to get the firmware back on it. – Unique Depiction Oct 21 '14 at 06:39
  • It had installed just fine when I plugged it in the first time. It's rt73 so it should be supported out of box. No lights even come on now when its plugged in. Sorry, I'm a linux noob, this is what I get: Bus 002 Device 004: ID 2001:3704 D-Link Corp. AirPlus G DWL-G122 Wireless Adapter(rev.A2) [Intersil ISL3887] – Unique Depiction Oct 21 '14 at 07:59
  • 1
    I found a solution here: http://askubuntu.com/questions/237392/how-to-get-an-intersil-isl3887-wireless-adaptor-working I did this: sudo apt-get install linux-firmware-nonfree – Unique Depiction Oct 21 '14 at 08:07
  • @UniqueDepiction I think rt73 is the old driver. You can install with these commands wget https://daemonizer.de/prism54/prism54-fw/fw-usb/2.13.25.0.lm87.arm --no-check-certificate then sudo mv 2.13.25.0.lm87.arm /lib/firmware/isl3887usb and sudo modprobe -r p54usb and finally sudo modprobe p54usb. Here's a link to the instructions https://wiki.debian.org/prism54#p54usb-1 and yours is the second generation ISL3887 – mchid Oct 21 '14 at 13:46