Opened 8 years ago

Closed 8 years ago

#7628 closed enhancement (fixed)

Upower-0.99.4 (Test dependent packages)

Reported by: Pierre Labastie Owned by: Pierre Labastie
Priority: normal Milestone: 7.10
Component: BOOK Version: SVN
Severity: normal Keywords:
Cc:

Description

Although the version seems to indicate that it is a pre-1.00 release, there is no indication that it is development in the NEWS file. At least for one package in the book (xfce4-power-manager), there is a new release, which depends on version 0.99.x of UPower (preceding one was 0.9.23). Several packages in the book depend on Upower, and should be tested with this new version.

Attachments (1)

lxsession-0.5.2-hibernate_consolekit-2.patch (8.6 KB ) - added by Pierre Labastie 8 years ago.
patch submitted upstream for LXDE suspend/hibernate without logind

Download all attachments as: .zip

Change History (21)

comment:1 by Pierre Labastie, 8 years ago

Owner: changed from blfs-book@… to Pierre Labastie
Status: newassigned

comment:2 by Armin K, 8 years ago

0.99.x has been already brought up at least once.

There is one issue that affects non-systemd systems - pm-utils support was removed from upower-0.99. To get suspend and hibernate support, you need systemd-logind. I am not sure if they added support for anything else since then.

in reply to:  2 comment:3 by Pierre Labastie, 8 years ago

Replying to Krejzi:

0.99.x has been already brought up at least once.

I should have checked, sorry.

There is one issue that affects non-systemd systems - pm-utils support was removed from upower-0.99. To get suspend and hibernate support, you need systemd-logind. I am not sure if they added support for anything else since then.

Do I understand correctly that for mobile devices to be able to suspend or hibernate in case of low power supply, you'll need systemd? Would you need the whole of systemd? Can't it be found in alternative packages such as eudev?

Problem is xfce4-power-manager does not build with older version of upower... Does it mean xfce4 is will become dependent on systemd?

comment:4 by Armin K, 8 years ago

Well, I did say systemd-logind, not systemd itself. It requires logind dbus interfaces. If I recall correctly, there was something called loginkit which emulated systemd logind interfaces via consolekit2. Not that I really looked it up or something like that.

comment:5 by Pierre Labastie, 8 years ago

Thanks. Loginkit has not received much updates lately, and is deemed unfinished, so I wouldn't use it. There is also a package elogind, which is an extract of logind from systemd. It is at version 219, while systemd is at version 230...

One good news: xfce4-power-manager has included hibernate/suspend code using pm-utils from old Upower, so UPower does not need systemd-logind in this case. I took more or less that informations from this link: http://www.gossamer-threads.com/lists/gentoo/dev/287606

One bad news : other applications might not have included that code, so either old UPower or systemd-logind is needed for low power generated hibernate/suspend.

comment:6 by Pierre Labastie, 8 years ago

I think I have a better view of the picture now. There are 2 possible dbus interfaces for suspend/hibernate: logind and ConsoleKit2. There used to be a third one (UPower), which is now gone. XFCE4 is set up to use logind or ConsoleKit (first logind presence is tested, then ConsoleKit), so no problem here. Liblxqt is set up to use UPower or logind for suspend/hibernate, or a "custom command". A custom command using pm-utils, would be easy to design, but what I do not know is how to make the system aware of this custom command. All I know is that it is kept into a msettings("power") class. Maybe a config file somewhere could allow to set it up.

I have not looked at lxde yet, nor at kde.

Note that the reboot/halt buttons work with lxqt, since ConsoleKit is used for those.

comment:7 by Pierre Labastie, 8 years ago

I have built plasma5 and kde5 apps. I do not see any button "hibernate" or "suspend", not even grayed or whatever. Shutdown and reboot buttons work. Does anybody, who have built kde5 with upower-0.9.23, see the "hibernate" or "suspend" button?

in reply to:  7 comment:8 by bdubbs@…, 8 years ago

Replying to pierre.labastie:

Does anybody, who have built kde5 with upower-0.9.23, see the "hibernate" or "suspend" button?

No, I do not have them either.

comment:9 by Pierre Labastie, 8 years ago

As far as I can see, only xfce4 is able to use consolekit2. That makes sense since the person maintaining consolekit2 is one of the xfce developpers. Well, what doesn't make sense is that none of the other desktops seems to be able to use consolekit2... On the other hand, The only missing bits are the capability to hibernate or suspend. Is this a problem? Maybe when using a laptop on batteries, it'd be nice to suspend the session when the battery is low.

If you only need to be able to put the system in suspend or hibernate mode, you can always run manually (for example for hibernation):

dbus-send --system                                     \
          --print-reply                                \
          --dest=org.freedesktop.ConsoleKit            \
          /org/freedesktop/ConsoleKit/Manager          \
          org.freedesktop.ConsoleKit.Manager.Hibernate \
          boolean:true

Of course, this could be an alias... That works with any DE in the book.

by Pierre Labastie, 8 years ago

patch submitted upstream for LXDE suspend/hibernate without logind

comment:10 by Pierre Labastie, 8 years ago

For LXDE, I have been able to make a patch, which allows using ConsoleKit2 for Suspend/Hibernate. I have submitted it upstream. I attach it here in case somebody wants to test it. Note that for LXDE, the recommended power manager is that of XFCE, which is able to use ConsoleKit2, so I guess that suspend on low battery would work (does anybody know how I could fake a low battery event on a desktop computer, possibly in a VM?).

comment:11 by bdubbs@…, 8 years ago

I built lxsession with the patch, but did not install it. I first checked my existing lxde installation. There I did have both suspend and hibernate options, but did not test. I have 15G or ram and a 20G swap partition (that is never used) on /dev/sdb10.

If I recall right, I need to modify the linux line in grub and add resume=/dev/sdb10. Does that sound right?

comment:12 by bdubbs@…, 8 years ago

Testing suspend from lxde without the patch, the video is restored, but I have no mouse or keyboard input. Even Ctrl-Alt-F2 does not work.

Killing lxde via ssh, the keyboard still does not work. It needs a reboot that I did via ssh.

I'm not sure if the patch will fix this.

comment:13 by Pierre Labastie, 8 years ago

If you have suspend from lxde without patch, I understand that you have the old (0.9.23) version of UPower, which implements suspend/hibernate through pm-utils. I have never tried that.

I think you do not need to install the new version of UPower to test the patch. The only difference is that you would not have the suspend and hibernate buttons with the new version of UPower, without the patch. The patch allows to use ConsoleKit instead of UPower, so maybe it can solve the mouse/keyboard problem. At least, with the patch, I do not see that problem.

BTW, I guess you have found by yourself, but yes, resume=/dev/sdb10 on the linux line in grub is the way to resume from hibernation (I guess you need some kernel build option to be set for hibernation to work).

I'll wait for upstream answer before doing anything more...

comment:14 by bdubbs@…, 8 years ago

You are right about still using the old version of UPower. I'll install that and try again. I do have the kernel options:

CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
...
CONFIG_OLD_SIGSUSPEND3=y
...
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_HIBERNATION=y

comment:15 by bdubbs@…, 8 years ago

I installed Upower-0.99.4 and the Suspend/Remove went away. I then reinstalled lxsession with the patch and Suspend/Remove returned.

Tried running pm-suspend from the command line and go the same input freeze, so it's not the gui and I don't think upower is involved. I can still ssh into the system.

From ssh, lsusb does not see the keyboard or mouse.

A little investigation shows that usb is not waking up. I'll investigate more since it is off topic for this ticket.

comment:16 by Pierre Labastie, 8 years ago

Patch has been accepted upstream, so LXDE has Suspend and Hibernate without using UPower. I think liblxqt could be modified in a similar way, so I think we can update UPower to version 0.99.4.

comment:17 by Pierre Labastie, 8 years ago

Added the patch to the book at r17276

comment:18 by Pierre Labastie, 8 years ago

I've not been able to look at a patch for LXQt: I've been mainly struggling with GCC 6 issues. LXQt/LXDE upstream is low on human resources, so we cannot expect them to provide a patch, I think.

comment:19 by Pierre Labastie, 8 years ago

Actually, upstream have just pushed a patch for LXQt https://github.com/lxde/liblxqt/commit/6246a14ad3c243cf55d77c1963d02ef52e6cf254. I've incorporated it into the book at r17382.

So only plasma5 needs to be examinated. I think I'll update the book (UPower and xfce4-power-management). Note that I have no idea how the DE's will do in response to low battery on laptops.

comment:20 by Pierre Labastie, 8 years ago

Resolution: fixed
Status: assignedclosed

Fixed at r17383

Note: See TracTickets for help on using tickets.