bit-team / backintime

Back In Time - An easy-to-use backup tool for GNU Linux using rsync in the back
https://backintime.readthedocs.io
GNU General Public License v2.0
2.02k stars 198 forks source link

Suspend is not inhibited for root backup/restore jobs #599

Open Schroedingers-Cat opened 8 years ago

Schroedingers-Cat commented 8 years ago

It would make sense to have an option preventing Linux from entering suspend during backup creation and recovery. ATM, Ubuntu 16.04 suspend timer needs to be disabled for BIT to finish its tasks.

Germar commented 8 years ago

Thats already implemented since version 1.1.0

Schroedingers-Cat commented 8 years ago

I'm using v1.1.12 on Ubuntu 16.04 and it doesn't work.

Is this an option I have to activate first? I checked the options menu twice before posting here.

Germar commented 8 years ago

It's default. No option for this.

BTW great thumbnail

Schroedingers-Cat commented 8 years ago

Thanks :)

Tell me, if you need more info to reproduce/fix this bug.

Germar commented 8 years ago

I just need to fix suspend/hibernate itself on my own machine to reproduce this :see_no_evil:

Germar commented 8 years ago

Okay, I fixed suspend on my machine but I'm still not able to reproduce the bug here.

Please run backintime backup --debug from terminal and post the output here. There should be these lines:

INFO: [common/tools.py:1121 inhibitSuspend] Inhibit Suspend started. Reason: take snapshot
...
INFO: [common/tools.py:1141 unInhibitSuspend] Release inhibit Suspend

Between these both lines suspend should be inhibited.

Schroedingers-Cat commented 8 years ago

I think that is the reason:

DEBUG: [common/tools.py:808 inhibitSuspend] Inhibit Suspend failed because BIT was started as root.

Germar commented 8 years ago

Ah, okay. I didn't found a way to inhibit suspend with root, yet. The normal method is using DBus SessionBus. But root has no SessionBus.

Schroedingers-Cat commented 8 years ago

Maybe you could somehow tunnel that command into a standard user?

Germar commented 8 years ago

That would get quite ugly. There must be an other way. I just have to search for it... :wink:

buhtz commented 8 months ago

This suspend/inhibit feature was discussed on several Issues. Might we think about to just remove it (with long running deprecation warning) from BIT? Is BIT responsible for that?

aryoda commented 8 months ago

This suspend/inhibit feature was discussed on several Issues. Might we think about to just remove it (with long running deprecation warning) from BIT? Is BIT responsible for that?

We are using a dbus call to block suspend and this does not work as root (just had a fix for an issue where dbus call hang forever as root: https://github.com/bit-team/backintime/issues/1592#issuecomment-1871524882).

I suggest to close this and pursue #714 (see my FR description there).

emtiu commented 8 months ago

Something is definitely wonky with this feature, as documented in #1090 (which may be a duplicateof #714). It's one of the most annoying things in my own daily usage of BiT.