I am running Centos 7 and all I want to do is make my computer go to sleep immediately. There is a setting I have set to make my computer go to sleep but only after a certain amount of inactivity but when I leave work, I want to be able to make it go to sleep immediately right after instead of turning my computer off.

I looked and found this link https://www.cyberciti.biz/faq/linux-command-to-suspend-hibernate-laptop-netbook-pc/ and I tried both commands

sudo systemctl suspend


sudo systemctl hibernate 

and get the message

A dependency job for suspend.target failed. See 'journalctl -xe' for details.

I just want to be able to make my computer go to sleep so that I can pick up from where I left off the day before instead of turning off my computer everytime I leave from work.


Do you have either the pm-suspend or pm-hibernate programs installed? These tools work independently of systemd, and thus would not be affected by systemd's problem. You can get both of these tools from the package pm-utils, although IDK if that package is available on CentOS (it's not in Fedora), so you might have to build it from source. You can get it from this git repo: git://anongit.freedesktop.org/git/pm-utils

You could also try install the uswusp package, although that might not be available in CenOS's repos, either. If you install this, you can use s2disk to hibernate, and s2ram to suspend to ram. You can get this program from Sourceforge.

A third option is to tell the system to suspend directly, without calling a specific program. This can be done by overwriting the /sys/power/state file with with "disk" to hibernate, or with "mem" to suspend. Do note that this file can only be modified by root. You could overwrite it by doing something like sudo sh -c 'printf mem > /sys/power/state', or echo disk | sudo dd status=none of=/sys/power/state.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.