1

From time to time I hibernate (suspend to disk) my machine using a shell script. Sometimes the procedure fails and the system does not hibernate at all or wakes up by itself shortly after it was suspended. Earlier, I used a tool which returned only after the system had resumed from hibernation (or immediately in case of an error) - so it was easy to distinguish between a successful and unsuccessful hibernation by merely checking the exit code and time which elapsed between the hibernation attempt and resume: if it was shorter than a certain threshold, I assumed that hibernation was unsuccessful, and I could take some recovery steps.

Now I have to use systemctl hibernate - which in general is ok, except that it asks the system to hibernate and returns immediately, while the hibernation works in background. Is there a simple method to check whether the system hibernated successfully in such circumstances?

I use OpenSUSE Leap 42.3, kernel version 4.4.104.

  • journalctl should tell you what happened. journalctl -b limits the output to events since last boot. – Mioriin Jan 21 '18 at 18:15

Your Answer

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

Browse other questions tagged or ask your own question.