4

After a long trial/error process, I finally identified crashplan service as the reason for my laptop not suspending after lid is closed. I have two different Ubuntu laptops, both are suffering from this problem...

I believe it will be difficult to influence crashplan to change this behavior, but I was wondering if it is possible to add an action to stop crashplan on when lid is closed and start it back when it is back on.

Any thoughts? Thanks!

1 Answer 1

1

Direct answer to your question:

You can use the lid switch to trigger a script that stops the Crashplan service. See Laptop Lid and Dock Scripts on the Help Wiki.

Also see comments and answers of Catch lid close and open events.

There are also a bunch of examples for scripts written for different kinds of events people wanted to trigger with the lid switch in the Ubuntu Forums--a bit chaotic, but the examples could be helpful as you write yours.

However, it may not actually be Crashplan that is the problem.

If your swap drive is encrypted, that could actually be what is interfering with hibernation. (In a way, Crashplan may have indirectly been the cause--I'll explain more...) You may not have knowingly set up an encrypted swap drive; this happens automatically when you choose to encrypt your home directory during installation of Ubuntu 9.10 and above.

Furthermore, you may never have noticed that your swap partition was encrypted because you would still have the ability to hibernate if your fstab identifies your swap space by UUID.

This only becomes a problem when your swap drive fills up (which it very likely might have done while you were running Crashplan, since many of its processes like file restores are long and resource/memory-intensive). When full, everything about the encrypted swap is overwritten, including UUID, so upon attempting to wake up from hibernation, your system wouldn't know where to find your swap drive--it would be searching for a UUID that didn't exist anymore.

So you may not need to write a "stop service" script activated by the lid switch at all. You may just need to deal with your swap.

Two possibilities are:

  1. Modifying your settings so that your swap drive is identified by /dev/sdXX instead of by UUID and also the system is supplied with a randomly generated key when needed (/dev/urandom). See this answer for explicit instructions. It involves editing crypttab and fstab, both of which you should back up before changing.

  2. Opting for unencrypted swap. Obviously, the latter is not a recommended solution, but personally I think that for the average user, it's not a huge deal to have an unencrypted swap partition. You can read more about it and decide for yourself. See here for instructions on how to do that.

Also see the Ubuntu Help Wiki on the caveats of encrypted home and how hibernation is affected.

Note: This question is 2 years old, so even though it would be best to get more information before answering, I thought it was unlikely the OP would respond, so I went ahead and posted an answer.

2
  • Wow, thank you Emily for this highly detailed response. In the past almost 3 yrs since I posted this, crashplan has retired its home backup services and I replaced it with "Back in Time", which works like a charm. That said, your response is very educational and appreciated. Apr 29, 2018 at 17:59
  • Hi SloppyPenguin, glad to hear you are still around! I still have my Crashplan home for another few months but I am in the process of switching to iDrive. What do you do about cloud storage with Back in Time? Also I'm curious if you've tried the restore process to test it out, and if so, were you happy with it?
    – Hee Jin
    Apr 30, 2018 at 13:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .