Taken from: http://ubuntuforums.org/showthread.php?t=2314905
With the new systemd configuration, the Unity menu's "hibernate" option does not call on pm-hibernate. It instead uses the hibernate and sleep service of logind / systemd. I'm using a tuxonice kernel, and the tlp power management setup on a thinkpad w520, running Ubuntu 16.04 (devel). I think this article is still relevant even if you don't have tlp or tuxonice, since it's systemd that changes how suspend and hibernate work.
When this laptop suspends or hibernates, sometimes the wifi stops working when it wakes back up. The solution is to unload the wifi device driver module prior to sleep, and then reload it upon resume, the way the "hibernate" script does, and "pm-hibernate" also did.
{CODE(colors="shell")}
/etc/systemd/system/wifi-modules-unload-reload.service
{CODE}
{CODE(colors="shell", caption="Contents of the previous file")}
# Unload and reload the wifi modules over suspend / resume.
[Unit]
Description=WIFI modules unload/reload over suspend/resume
Before=sleep.target
StopWhenUnneeded=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/modprobe -r iwldvm
ExecStop=/sbin/modprobe iwldvm
[Install]
WantedBy=sleep.target
{CODE}
The other problem I had was that, using tuxonice, the user ui program was not visible during the hibernation process. I fixed this with:
{CODE(colors="shell")}
sudo nano /etc/systemd/system/tuxonice-vtswitch.service
{CODE}
{CODE(colors="shell", caption="Contents of the previous file")}
# Switch vt for tuxonice UI
[Unit]
Description=Switch VT for tuxonice UI
Before=sleep.target
StopWhenUnneeded=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/chvt 63 ; /bin/sh -c "/bin/echo -ne '\033%@' > /dev/tty63"
ExecStop=/bin/chvt 7
[Install]
WantedBy=sleep.target
{CODE}
Enable them with:
{CODE(colors="shell")}
sudo systemctl enable wifi-modules-unload-reload.service
sudo systemctl enable tuxonice-vtswitch.service
{CODE}
This worked well in the macbookpro laptop from 2008.
If the previous trick doesn't work (like in a hp laptop with dual graphics card), try this other one:
https://www.youtube.com/watch?v=l8xa-PkDhhk
{CODE()}
sudo gedit /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash'"
to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor acpi_osi='!Windows 2013' acpi_osi='!Windows 2012'"
sudo update-grub
reboot twice!!
{CODE}
However, this didn't work for me. Hibernation or suspending fails in that computer with dual graphics card (ati + intel)