Restart spawns a password box

Bug #1178373 reported by Elfy
48
This bug affects 11 people
Affects Status Importance Assigned to Milestone
Xfce4 Session
Fix Released
Medium
xfce4-session (Ubuntu)
Fix Released
High
Lionel Le Folgoc

Bug Description

Daily live Xubuntu.

Go to Logout button - choose Restart.

Box requiring password appears - impossible to enter password to proceed.

Have to logout then shutdown then restart.

Shutdown spawns the same password box.

If you login as Guest then Shutdown/restart work as anticipated.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: lightdm 1.7.0-0ubuntu2
ProcVersionSignature: Ubuntu 3.9.0-1.5-generic 3.9.1
Uname: Linux 3.9.0-1-generic x86_64
ApportVersion: 2.10-0ubuntu1
Architecture: amd64
Date: Thu May 9 19:26:05 2013
InstallationDate: Installed on 2013-05-09 (0 days ago)
InstallationMedia: Xubuntu 13.10 "Saucy Salamander" - Alpha amd64 (20130509)
LightdmConfig:
 [SeatDefaults]
 greeter-session=lightdm-gtk-greeter
 user-session=xubuntu
LightdmGreeterLog:
 ** (lightdm-gtk-greeter:1094): WARNING **: Failed to open sessions directory: Error opening directory '/usr/share/lightdm/remote-sessions': No such file or directory

 ** (lightdm-gtk-greeter:1094): WARNING **: Failed to load user image: Failed to open file '/home/hob/.face': No such file or directory
LightdmGreeterLogOld:
 ** (lightdm-gtk-greeter:1570): WARNING **: Failed to open sessions directory: Error opening directory '/usr/share/lightdm/remote-sessions': No such file or directory

 ** (lightdm-gtk-greeter:1570): WARNING **: Failed to load user image: Failed to open file '/home/hob/.face': No such file or directory
MarkForUpload: True
SourcePackage: lightdm
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
In , nirik (kevin-scrye) wrote :

With:

http://cgit.freedesktop.org/upower/commit/?id=9843589d2d80e6dc2b3f51338e64bd1da1c53860

upower is deprecating suspend/hibernate interface.

http://lists.freedesktop.org/archives/devkit-devel/2013-January/001339.html

It looks like xfce4-session doesn't include upower.h, but has it's own interface to upower?

Revision history for this message
In , nirik (kevin-scrye) wrote :

http://www.freedesktop.org/wiki/Software/systemd/logind

has information about the logind dbus interface.

Revision history for this message
In , nirik (kevin-scrye) wrote :
Revision history for this message
In , 8-nick (8-nick) wrote :

To upower is deprecating the suspend/hibernate api in favour of using systemd?

Revision history for this message
In , Rex Dieter (rdieter) wrote :

Yes, if built with --enable-systemd option, now it will use systemd suspend/hibernate methods instead of upower.

Revision history for this message
In , Mikhefr (mikhefr) wrote :

Created attachment 4995
Add-systemd-logind-support-for-suspend-hibernate.patch

Patch for current master branch.

Revision history for this message
In , Mikhefr (mikhefr) wrote :

Created attachment 5004
Add-systemd-logind-support-for-suspend-hibernate2.patch

Updated patch with 'lock screen' support.

Revision history for this message
Elfy (elfy) wrote :
description: updated
Revision history for this message
Elfy (elfy) wrote :
Elfy (elfy)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lightdm (Ubuntu):
status: New → Confirmed
Revision history for this message
Paulo Narciso (p-narciso) wrote :

In my case, I can introduce root password to restart/shutdown.

Revision history for this message
Iain Lane (laney) wrote :

Hi,

This is because lightdm has been ported to logind and away from ConsoleKit for session management.

xfce4-session should follow suit and use logind too. I see that in 4.10.1 it's part of the way there - if I upgrade to this then restart works again. To get suspend working I've additionally patched to use logind for suspend too. The same code should be introduced for hibernate as well - my patch is incomplete and definitely should go upstream.

UPower wants to remove these APIs (suspend/hibernate).
  http://lists.freedesktop.org/archives/devkit-devel/2013-January/001339.html

I'll leave finishing and uploading to the Xubuntu developers.

Cheers!

Changed in lightdm (Ubuntu):
status: Confirmed → Invalid
Changed in lightdm:
status: New → Invalid
Revision history for this message
Jackson Doak (noskcaj) wrote :

i think this may have something to do with how the "shutdown" command works. it needs sudo

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xfce4-session (Ubuntu):
status: New → Confirmed
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1178373

tags: added: iso-testing
no longer affects: xfwm4
Revision history for this message
Elfy (elfy) wrote :

Thanks Lionel

Revision history for this message
Elfy (elfy) wrote :

Still seeing the same issue in this machine. Upgraded and completely up to date.

Revision history for this message
Jane Atkinson (irihapeti) wrote :

Still seeing this here as well, on an up-to-date install.

no longer affects: lightdm (Ubuntu)
affects: lightdm → xfce4-session
Changed in xfce4-session:
importance: Undecided → Unknown
status: Invalid → Unknown
Changed in xfce4-session (Ubuntu):
status: Confirmed → In Progress
importance: Undecided → High
assignee: nobody → Lionel Le Folgoc (mrpouit)
Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

I've uploaded a test package in my ppa (no need to add the repository, just grab the xfce4-session/saucy package).
Feedback welcome, thanks.

(PS: the package hasn't built yet, cf. https://launchpad.net/~mrpouit/+archive/ppa/+build/4758749 and https://launchpad.net/~mrpouit/+archive/ppa/+build/4758748)

Revision history for this message
Elfy (elfy) wrote :

I've tested that with logout/restart/shutdown - all seems to be working ok here with the 64bit package.

Revision history for this message
David Pires (slickymaster) wrote :

Still seeing this here as well, on today's i386 daily build.

Revision history for this message
David Pires (slickymaster) wrote :

Tested with Lionel's i386 build of xfce4-session 4.10.1-1ubuntu1~test1 and all seems to work ok.

Also, even the issue of the missing suspend button (reported in Bug #336272) seems to be solved with this package. I'm going to post a comment on that bug reported indicating it.

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Thanks, uploading to saucy then.

Changed in xfce4-session (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
In , Lionel Le Folgoc (mrpouit) wrote :

Created attachment 5085
Add logind runtime detection

I took the patch from this bug report and from Bug #10076 to combine them (suspend/hibernate support + logind runtime detection). It could probably be done in a nicer way, but it seems to work fine.

(I tested with the 4.10.1 release tarball so it won't apply as is over git, e.g. replace configure.ac with configure.ac.in in the patch.)

Revision history for this message
Elfy (elfy) wrote :

I'll uninstall the one from your PPA and wait for it to turn up in an update.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xfce4-session - 4.10.1-1ubuntu1

---------------
xfce4-session (4.10.1-1ubuntu1) saucy; urgency=low

  * Merge from Debian unstable, remaining Ubuntu changes:
    - debian/patches:
      + xubuntu_ignore-gdm-lang.patch: do not set $LANG to $GDM_LANG, there's
        already an xsession script to do that, and $GDM_LANG might not contain
        a valid locale code.
      + xubuntu_set-xdg-current-desktop.patch: added. Taken from xfce4-utils,
        export XDG_CURRENT_DESKTOP=XFCE, can be useful with alacarte and
        gnome-menus. lp #927172

  * debian/patches:
    - xfsm-startup-random-crash.patch: dropped, included in 4.10.1.
    - xubuntu_ignore-gdm-lang.patch: updated to apply cleanly.

  * Check for logind support at runtime (lp: #1178373):
    - debian/patches/xubuntu_runtime-logind-support.patch: added.
    - debian/rules:
      + call xdt-autogen after patching
      + clean up autogenerated files modified by xdt-autogen.
    - debian/control:
      + add build-dep on libpolkit-gobject-1-dev (>= 0.100).
      + add build-dep on xfce4-dev-tools and libtool in order to run xdt-autogen
        after patching.
      + don't recommend consolekit anymore.

xfce4-session (4.10.1-1) unstable; urgency=low

  * New upstream release.
  * Upload to unstable.
  * debian/rules:
    - enable all hardening flags.
  * debian/patches:
    - drop all patches, included upstream.
 -- Lionel Le Folgoc <email address hidden> Mon, 01 Jul 2013 19:35:39 +0200

Changed in xfce4-session (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Elfy (elfy) wrote :

Enabled proposed, upgraded this package. All fine here.

Revision history for this message
David Pires (slickymaster) wrote :

Also upgraded the package, and everything is running smoothly.

Revision history for this message
In , Samuli Suominen (ssuominen) wrote :

yeap, the logind / ConsoleKit detection(s) should be done at runtime, so user can boot with whatever init= he has, in Gentoo's case, OpenRC (ConsoleKit) _or_ systemd (logind)

just saying :)

Revision history for this message
In , Guido Berhoerster (gber) wrote :

Created attachment 5117
support suspend/hibernate through logind

(In reply to Lionel Le Folgoc from comment #7)
> Created attachment 5085 [details]
> Add logind runtime detection
>
> I took the patch from this bug report and from Bug #10076 to combine them
> (suspend/hibernate support + logind runtime detection). It could probably be
> done in a nicer way, but it seems to work fine.
>
> (I tested with the 4.10.1 release tarball so it won't apply as is over git,
> e.g. replace configure.ac with configure.ac.in in the patch.)

Your patch calls g_object_unref() on potentially uninitialized or NULL pointers (shutdown->consolekit and shutdown->systemd in xfce4-session/xfsm-shutdown.c:xfsm_shutdown_finalize()). The attached patch fixes that and also moves the LOGIND_RUNNING macro into xfce4-session/xfsm-systemd.h and caches its result in xfce4-session/xfsm-shutdown.c. It applies to current git.

Revision history for this message
In , Yves-Alexis Perez (corsac) wrote :

What's the status on these patches?

Revision history for this message
In , b3nmore (b3nmore) wrote :

(In reply to Guido Berhoerster from comment #9)
> Created attachment 5117 [details]
> support suspend/hibernate through logind

Would it be possible to implement the HybridSleep() method as well?

Revision history for this message
In , Vladimír Čunát (vcunat) wrote :

Is there some reason why no solution of some kind has been integrated into the official repository? People still can even work around it by passing --enable-deprecated to upower's configure (as we do on NixOS now), but in time most distros will need a better solution.

Revision history for this message
In , Yves-Alexis Perez (corsac) wrote :

(In reply to Vladimír Čunát from comment #12)
> Is there some reason why no solution of some kind has been integrated into
> the official repository? People still can even work around it by passing
> --enable-deprecated to upower's configure (as we do on NixOS now), but in
> time most distros will need a better solution.

Because nobody volunteered for maintaining xfce4-session long term, unfortunately.

Revision history for this message
In , Eric Koegel (eric-koegel) wrote :

Created attachment 5498
Suspend/hibernate upower 0.99 (no logind)

Since everyone else is doing the logind piece, I wrote a small patch so xfce4-session will work with upower 0.99 but without logind.

Revision history for this message
In , Guido Berhoerster (gber) wrote :

(In reply to Eric Koegel from comment #14)
> Created attachment 5498 [details]
> Suspend/hibernate upower 0.99 (no logind)
>
> Since everyone else is doing the logind piece, I wrote a small patch so
> xfce4-session will work with upower 0.99 but without logind.

Although I think it would be a good thing not to rely on logind, please do not extend this crude and ugly sudo hack that BSD and Solaris users have to put up with, but replace xfsm-shutdown-helper with a small DBus service and use PolicyKit to authorize access to shutdown/suspend methods. xfsm-shutdown-helper should just go away, PolicyKit is nowadays available even on the BSDs and Solaris.

Changed in xfce4-session:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Eric Koegel (eric-koegel) wrote :

(In reply to Guido Berhoerster from comment #15)
> (In reply to Eric Koegel from comment #14)
> > Created attachment 5498 [details]
> > Suspend/hibernate upower 0.99 (no logind)
> >
> > Since everyone else is doing the logind piece, I wrote a small patch so
> > xfce4-session will work with upower 0.99 but without logind.
>
> Although I think it would be a good thing not to rely on logind, please do
> not extend this crude and ugly sudo hack that BSD and Solaris users have to
> put up with, but replace xfsm-shutdown-helper with a small DBus service and
> use PolicyKit to authorize access to shutdown/suspend methods.
> xfsm-shutdown-helper should just go away, PolicyKit is nowadays available
> even on the BSDs and Solaris.

Indeed, I can look into doing that. I didn't know how long it would take to get a new project accepted by distros, especially something running as root. In the meantime, extending shutdown-helper will work until I (or someone) makes a daemon for that.

Revision history for this message
In , Samuli Suominen (ssuominen) wrote :

(In reply to Eric Koegel from comment #14)
> Created attachment 5498 [details]
> Suspend/hibernate upower 0.99 (no logind)
>
> Since everyone else is doing the logind piece, I wrote a small patch so
> xfce4-session will work with upower 0.99 but without logind.

There is a problem with this patch, it makes upower a hardcoded mandatory depend, whereas it should be considered optional, see http://bugs.gentoo.org/512084 for example
Should not use XDT_CHECK_PACKAGE([UPOWER],[upower-glib], [0.9.8]) but perhaps XDT_CHECK_OPTIONAL_PACKAGE instead, or put it somehow behind some 'ifdef'

Thanks

Revision history for this message
In , Guido Berhoerster (gber) wrote :

(In reply to Eric Koegel from comment #16)
> (In reply to Guido Berhoerster from comment #15)
> > (In reply to Eric Koegel from comment #14)
> > > Created attachment 5498 [details]
> > > Suspend/hibernate upower 0.99 (no logind)
> > >
> > > Since everyone else is doing the logind piece, I wrote a small patch so
> > > xfce4-session will work with upower 0.99 but without logind.
> >
> > Although I think it would be a good thing not to rely on logind, please do
> > not extend this crude and ugly sudo hack that BSD and Solaris users have to
> > put up with, but replace xfsm-shutdown-helper with a small DBus service and
> > use PolicyKit to authorize access to shutdown/suspend methods.
> > xfsm-shutdown-helper should just go away, PolicyKit is nowadays available
> > even on the BSDs and Solaris.
>
> Indeed, I can look into doing that. I didn't know how long it would take to
> get a new project accepted by distros, especially something running as root.
> In the meantime, extending shutdown-helper will work until I (or someone)
> makes a daemon for that.

I don't think that it's big deal, it will not be used by most major Linux distros anyway since they are all systemd-based and there is already precedence with xfpm-backlight-helper which gets executed as root through polkit.
Speaking of, could you just execute xfpm-pm-helper through pkexec instead of sudo in the same way it is done with xfpm-backlight-helper?
xfpm-pm-helper should probably disabled by default on Linux since distros either carry upower < 0.99 or they have upower >= 0.99 and systemd.
Finally it'd be nice to install all of these helpers under $(libexecdir) instead of $(bindir) since they're not meant to be executed directly by the user and clutter $PATH. Thanks in advance.

Revision history for this message
In , Samuli Suominen (ssuominen) wrote :

(In reply to Guido Berhoerster from comment #18)
> I don't think that it's big deal, it will not be used by most major Linux
> distros anyway since they are all systemd-based and there is already
> precedence...
> xfpm-pm-helper should probably disabled by default on Linux since distros
> either carry upower < 0.99 or they have upower >= 0.99 and systemd.

Gentoo will provide UPower >= 0.99 by default for both, OpenRC (non-systemd) and systemd users. We have no plans in dropping the support for the sysvinit+OpenRC combination, but we plan to support systemd in parallel fully. We have no plans on retiring pm-utils either anytime soon.

Revision history for this message
In , Eric Koegel (eric-koegel) wrote :

Created attachment 5541
Suspend/hibernate upower 0.99 (no logind)

So this version makes upower optional but still uses the shutdown helper.

Revision history for this message
In , Yves-Alexis Perez (corsac) wrote :

(In reply to Eric Koegel from comment #20)
> Created attachment 5541 [details]
> Suspend/hibernate upower 0.99 (no logind)
>
> So this version makes upower optional but still uses the shutdown helper.

Hmhm, so this one completely ignores logind? Is it really an improvement wrt. the runtime detection patch?

Revision history for this message
In , Guido Berhoerster (gber) wrote :

(In reply to Eric Koegel from comment #20)
> Created attachment 5541 [details]
> Suspend/hibernate upower 0.99 (no logind)
>
> So this version makes upower optional but still uses the shutdown helper.

A couple of notes:
- OpenBSD supports hibernation via /usr/sbin/ZZZ or /usr/sbin/apm -Z
- on FreeBSD you might want to call /usr/sbin/acpiconf -s 3 for suspend for consistency, /usr/sbin/zzz still supports APM but I doubt there is any APM-supporting hardware left
- on FreeBSD you can check for suspend/hibernate support by looking at the hw.acpi.supported_sleep_state property through the sysctl API, see sysctl(3)[1] and acpi(4)[2]

[1] http://www.freebsd.org/cgi/man.cgi?query=sysctl&sektion=3&apropos=0&manpath=FreeBSD+10.0-stable
[2] http://www.freebsd.org/cgi/man.cgi?query=acpi&apropos=0&sektion=4&manpath=FreeBSD+10.0-stable&arch=default&format=html

Also the long term plan still is to use a DBus-actiavted helper instead of sudo? Where should this live, both xfce4-session and xfce4-power-manager need to make use of it but either one depending on the other would probably not be nice. People run Xfce without xfpm and and xfpm is used outside Xfce.

Revision history for this message
In , Samuli Suominen (ssuominen) wrote :

(In reply to Eric Koegel from comment #20)
> Created attachment 5541 [details]
> Suspend/hibernate upower 0.99 (no logind)
>
> So this version makes upower optional but still uses the shutdown helper.

The patch is still missing bunch of #ifdef UPOWER lines:

xfsm-upower.c:24:20: fatal error: upower.h: No such file or directory

And when you add #ifdef UPOWER around that #include <upower.h>, the same file still has code without #ifdef's:

xfsm-upower.c:304:22: error: missing binary operator before token "("

Please try the patch with a system that doesn't have upower headers installed, and with --disable-upower

Thanks!

Revision history for this message
In , Eric Koegel (eric-koegel) wrote :

Created attachment 5545
Suspend/hibernate upower 0.99 (no logind)

(In reply to Eric Koegel from comment #20)
> Created attachment 5541 [details]
> Suspend/hibernate upower 0.99 (no logind)
>
> So this version makes upower optional but still uses the shutdown helper.

Hmhm, so this one completely ignores logind? Is it really an improvement wrt. the runtime detection patch?
-------------

The hope is that this path will be used if the logind running check fails (i.e. FreeBSD, OpenBSD, Gentoo, Slackware, etc). So if you're using systemd this patch is nice but not useful.

------------
(In reply to Eric Koegel from comment #20)
> Created attachment 5541 [details]
> Suspend/hibernate upower 0.99 (no logind)
>
> So this version makes upower optional but still uses the shutdown helper.

A couple of notes:
- OpenBSD supports hibernation via /usr/sbin/ZZZ or /usr/sbin/apm -Z
- on FreeBSD you might want to call /usr/sbin/acpiconf -s 3 for suspend for consistency, /usr/sbin/zzz still supports APM but I doubt there is any APM-supporting hardware left
- on FreeBSD you can check for suspend/hibernate support by looking at the hw.acpi.supported_sleep_state property through the sysctl API, see sysctl(3)[1] and acpi(4)[2]

[1] http://www.freebsd.org/cgi/man.cgi?query=sysctl&sektion=3&apropos=0&manpath=FreeBSD+10.0-stable
[2] http://www.freebsd.org/cgi/man.cgi?query=acpi&apropos=0&sektion=4&manpath=FreeBSD+10.0-stable&arch=default&format=html

Also the long term plan still is to use a DBus-actiavted helper instead of sudo? Where should this live, both xfce4-session and xfce4-power-manager need to make use of it but either one depending on the other would probably not be nice. People run Xfce without xfpm and and xfpm is used outside Xfce.
--------------

Thanks for all the info and links! I've hopefully got all that in there, but let me know if I've got it wrong.

My idea for the Dbus helper is actually to write a daemon to provide some of the logind API, as in: PowerOff, Reboot, Suspend, Hibernate, HybridSleep, the Can stuff (like CanPowerOff), Inhibit, and the PrepareForShutdown, PrepareForSleep signals. This way other applications outside of xfce can use it too and without having to adapt to yet another API since they'll be similar. But it may take me some time which is why I wrote this patch.

--------------
(In reply to Eric Koegel from comment #20)
> Created attachment 5541 [details]
> Suspend/hibernate upower 0.99 (no logind)
>
> So this version makes upower optional but still uses the shutdown helper.

The patch is still missing bunch of #ifdef UPOWER lines:

xfsm-upower.c:24:20: fatal error: upower.h: No such file or directory

And when you add #ifdef UPOWER around that #include <upower.h>, the same file still has code without #ifdef's:

xfsm-upower.c:304:22: error: missing binary operator before token "("

Please try the patch with a system that doesn't have upower headers installed, and with --disable-upower

Thanks!
------------

Sorry! This new patch should be much better (it actually compiles with and without upower on everything the Jenkins instance currently supports).

Revision history for this message
In , Yves-Alexis Perez (corsac) wrote :

(In reply to Eric Koegel from comment #24)
> Created attachment 5545 [details]
> Suspend/hibernate upower 0.99 (no logind)
>
>
> (In reply to Eric Koegel from comment #20)
> > Created attachment 5541 [details]
> > Suspend/hibernate upower 0.99 (no logind)
> >
> > So this version makes upower optional but still uses the shutdown helper.
>
> Hmhm, so this one completely ignores logind? Is it really an improvement
> wrt. the runtime detection patch?
> -------------
>
> The hope is that this path will be used if the logind running check fails
> (i.e. FreeBSD, OpenBSD, Gentoo, Slackware, etc). So if you're using systemd
> this patch is nice but not useful.

So it should be added on top of the logind runtime detection patch?

Revision history for this message
In , Eric Koegel (eric-koegel) wrote :
Revision history for this message
In , Samuli Suominen (ssuominen) wrote :

I have to reopen because the pushed patch does not include proper support for systems with no systemd, but with UPower 0.99.0
The patch from Eric in this bug does it all, full support for both systemd and non-systemd systems, it's what we rely upon in Gentoo, for example
Otherwise Xfce wouldn't have Hibernate & Suspend at all for us by default

Revision history for this message
In , Samuli Suominen (ssuominen) wrote :

As in, Comment #24 has working patch

Revision history for this message
In , Eric Koegel (eric-koegel) wrote :

In xfsm_shutdown_try_suspend the logic is:
SystemD ? use LoginD suspend
Upower < 0.99 ? use Upower suspend
Otherwise lock the screen and call pkexec xfsm-shutdown-helper --suspend

http://git.xfce.org/xfce/xfce4-session/tree/xfce4-session/xfsm-shutdown.c#n312

Same for hibernate. I've been testing with a system that has consolekit + upower git master (it calls itself 0.99.2). Or is this for systems without polkit installed (or polkit-gobject-1 which is used for the fallback instead of sudo)? Just trying to figure out where it's gone wrong so we can fix it.

Does pkaction --action-id org.xfce.session.xfsm-shutdown-helper -v return anything?

Revision history for this message
In , Samuli Suominen (ssuominen) wrote :

(In reply to Eric Koegel from comment #29)
> In xfsm_shutdown_try_suspend the logic is:
> SystemD ? use LoginD suspend
> Upower < 0.99 ? use Upower suspend
> Otherwise lock the screen and call pkexec xfsm-shutdown-helper --suspend
>
> http://git.xfce.org/xfce/xfce4-session/tree/xfce4-session/xfsm-shutdown.
> c#n312
>
> Same for hibernate. I've been testing with a system that has consolekit +
> upower git master (it calls itself 0.99.2). Or is this for systems without
> polkit installed (or polkit-gobject-1 which is used for the fallback instead
> of sudo)? Just trying to figure out where it's gone wrong so we can fix it.
>
> Does pkaction --action-id org.xfce.session.xfsm-shutdown-helper -v return
> anything?

The target system where I *assumed* the committed patch wouldn't work is with active ConsoleKit session, working PolicyKit, no systemd, UPower 0.99.1 (or git, no real difference in this regard, as in, just UPower with no hibernate and suspend capabilities) -- a system, where I expect Hibernate and Suspend buttons to do direct pm-* command calls like the patch in Comment #24 does

So, sorry, I didn't actually had chance to test it out yet, but I just can't see the code that calls pm-suspend anywhere

Revision history for this message
In , Eric Koegel (eric-koegel) wrote :

(In reply to Samuli Suominen from comment #30)
> (In reply to Eric Koegel from comment #29)
> > In xfsm_shutdown_try_suspend the logic is:
> > SystemD ? use LoginD suspend
> > Upower < 0.99 ? use Upower suspend
> > Otherwise lock the screen and call pkexec xfsm-shutdown-helper --suspend
> >
> > http://git.xfce.org/xfce/xfce4-session/tree/xfce4-session/xfsm-shutdown.
> > c#n312
> >
> > Same for hibernate. I've been testing with a system that has consolekit +
> > upower git master (it calls itself 0.99.2). Or is this for systems without
> > polkit installed (or polkit-gobject-1 which is used for the fallback instead
> > of sudo)? Just trying to figure out where it's gone wrong so we can fix it.
> >
> > Does pkaction --action-id org.xfce.session.xfsm-shutdown-helper -v return
> > anything?
>
> The target system where I *assumed* the committed patch wouldn't work is
> with active ConsoleKit session, working PolicyKit, no systemd, UPower 0.99.1
> (or git, no real difference in this regard, as in, just UPower with no
> hibernate and suspend capabilities) -- a system, where I expect Hibernate
> and Suspend buttons to do direct pm-* command calls like the patch in
> Comment #24 does
>
> So, sorry, I didn't actually had chance to test it out yet, but I just can't
> see the code that calls pm-suspend anywhere

Well for that case:
xfsm_shutdown_try_suspend
http://git.xfce.org/xfce/xfce4-session/tree/xfce4-session/xfsm-shutdown.c#n312
  xfsm_upower_lock_screen (which just ends up calling xflock4 and ignoring the other stuff)
http://git.xfce.org/xfce/xfce4-session/tree/xfce4-session/xfsm-upower.c#n289
  xfsm_shutdown_fallback_try_action XFSM_SHUTDOWN_SUSPEND
http://git.xfce.org/xfce/xfce4-session/tree/xfce4-session/xfsm-shutdown.c#n242
    pkexec " XFSM_SHUTDOWN_HELPER_CMD " --%s", action

http://git.xfce.org/xfce/xfce4-session/tree/xfsm-shutdown-helper/main.c#n86
#define UP_BACKEND_SUSPEND_COMMAND "/usr/sbin/pm-suspend"
#define UP_BACKEND_HIBERNATE_COMMAND "/usr/sbin/pm-hibernate"
Which gets used in:
http://git.xfce.org/xfce/xfce4-session/tree/xfsm-shutdown-helper/main.c#n218

That is assuming your PC can suspend and you are authorized to suspend,
http://git.xfce.org/xfce/xfce4-session/tree/xfce4-session/xfsm-shutdown.c#n577
http://git.xfce.org/xfce/xfce4-session/tree/xfce4-session/xfsm-shutdown.c#n667

Once everyone has migrated to UPower 1.0 we can actually remove all the upower stuff from xfsm since it doesn't do anything anymore. But that could be several years down the road.

Revision history for this message
In , Samuli Suominen (ssuominen) wrote :

Sorry, totally my bad, I should have investigated futher. This new code setup looks nicely organized. Thanks!

I'll give it proper testing, meanwhile, sorry for reopening...

Changed in xfce4-session:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.