! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Session isnt saved when shutdown or reboot
Status:
RESOLVED: FIXED
Product:
Xfce4-session
Component:
General

Comments

Description Landry Breuil editbugs 2012-05-09 10:25:33 CEST
With either sudo fallback or consolekit, my session isn't saved if i shutdown or reboot, the .cache/session/ xfce4-session-$(hostname):0 file is not updated.

It's saved properly if i logout.

AutoSave and SaveOnExit xfconf properties are both true.

I've looked at the code and it's as if xfsm_manager_store_session() wasnt called. I'll try with XFSM_VERBOSE set in the env to see if i can find the issue.
Comment 1 Landry Breuil editbugs 2012-05-09 20:52:38 CEST
Created attachment 4411 
verbose logout
Comment 2 Landry Breuil editbugs 2012-05-09 20:53:34 CEST
Created attachment 4412 
verbose reboot

And here are the logs with XFSM_VERBOSE=1. It's as if the SAVE YOURSELF step was skipped...
Comment 3 Landry Breuil editbugs 2012-07-19 21:16:54 CEST
After leengthy debugging, it seems to me that the codepath taken in xfsm-manager.c is :
xfsm_manager_dbus_logout
xfsm_manager_save_yourself_dbus
xfsm_manager_dbus_shutdown_idled
xfsm_manager_save_yourself_global

problem is, xfsm_manager_dbus_logout gets passed false for allow_save, regardless of the SaveOnExit/AutoSave properties. and in xfsm_manager_save_yourself_global(), since shutdown_save gets false, the session is not saved when shutdown is true...

Now, to find what calls xfsm_manager_dbus_logout (via dbus i suppose)..
Comment 4 Landry Breuil editbugs 2012-07-19 21:30:26 CEST
So, in the case of xfce4-session-logout, allow_save defaults to FALSE, and is changed if -f is passed..
And in the case of the actions plugin, allow_save comes from the 'unattended' value which defaults to FALSE and can be changed by the 'action_confirmation' dialog. I'm not sure the unattended variable has the same semantic as allow_save.

So, from my understanding, the SaveOnExit xfconf property was used in the old xfsm-logout-dialog.c in 4.8, which isnt used anymore (i think) in 4.10. And as it is now, if you dont use a confirmation dialog when shutting down (and that might even change nothing), the session will never be saved.
Comment 5 Landry Breuil editbugs 2012-07-19 21:44:30 CEST
More tests.. after using the confirmation dialog in the actions plugin, the session is _not_ saved when shutting down/rebooting.

Interestingly, xfce4-session-logout -f -r does set allow_save to try, and that effectively saves the session.

So, from here, i'd say we have two bugs :

- one in xfce4-session-logout, where the logic of -f is reversed, and it doesnt honour SaveOnExit (the intent of -f was probably to override it)

- one in the actions plugin, where the second parameter of the dbus call should honour SaveOnExit instead of coming from a random value defaulting to false ?

I can fix those bugs, i just want to get confirmation i'm in the right direction.

Or the plan was to deprecate/unuse SaveOnExit ?
Comment 6 Landry Breuil editbugs 2012-07-19 22:00:59 CEST
Finally, wild guess but i'd say http://git.xfce.org/xfce/xfce4-session/commit/?id=4002e8d4ef3905e878e44633c076f8e7d42fd91b might be the commit that broke the logout. SaveOnExit/AutoSave looks more unused after that commit... in the new code, i wonder how is xfsm-logout-dialog.c called ? It only seems called in xfsm-manager.c:1102.
Comment 7 Landry Breuil editbugs 2012-07-19 22:09:21 CEST
And finally, another way to get the session properly saved on reboot/powerdown :

xfce4-session-logout without parameters brings the logout dialog from xfsm-logout-dialog.c, click on poweroff/reboot => sets shutdown_save to 1 based on SaveOnExit xfconf property, and then saves the session before exiting.
Comment 8 Nick Schermer editbugs 2012-07-22 10:55:58 CEST
Created attachment 4555 
Fix --fast option in xfce4-session-logout
Comment 9 Nick Schermer editbugs 2012-07-22 11:14:33 CEST
Created attachment 4556 
Fix unattended in xfce4-panel
Comment 10 Nick Schermer editbugs 2012-07-22 11:19:55 CEST
Created attachment 4557 
Read SaveOnExit in xfsm_manager_save_yourself_global

Read the actual value from xfconf if allow_shutdown_save is TRUE.
Comment 11 Nick Schermer editbugs 2012-08-06 15:11:16 CEST
*** Bug 9181 has been marked as a duplicate of this bug. ***
Comment 12 Jérôme Guelfucci editbugs 2012-08-30 23:12:25 CEST
What is the status of this bug? Bug #8678 is the same issue.

In your last patch for xfsm-manager.c, why do you read the value from xfconf? Shouldn't xfsm_manager_save_yourself_global always respect the passed parameter and the actions plugin read / pass the correct value from xfconf?
Comment 13 Landry Breuil editbugs 2012-08-31 08:57:00 CEST
Status is still in flux, two fixes were commited to git :

http://git.xfce.org/xfce/xfce4-session/commit/?id=499a719019e03da90b6901bb0f8a89d06ae167ee
http://git.xfce.org/xfce/xfce4-panel/commit/?id=17643fd28f499691ae97503eb58755b4b9fabb53

I dont really remember if more is needed, nor what should take precedence on what..
Comment 14 Jérôme Guelfucci editbugs 2012-12-18 13:43:38 CET
The last remaining bit seems to be bug #7930, the panel plugin does not respect the settings.

Bug #8857

Reported by:
Landry Breuil
Reported on: 2012-05-09
Last modified on: 2012-12-18
Duplicates (1):
  • 9181 The session is saved ignoring the SaveOnExit being false.

People

Assignee:
Nick Schermer
CC List:
4 users

Version

Version:
4.10.0

Attachments

verbose logout (14.04 KB, text/plain)
2012-05-09 20:52 CEST , Landry Breuil
no flags
verbose reboot (13.12 KB, text/plain)
2012-05-09 20:53 CEST , Landry Breuil
no flags
Fix --fast option in xfce4-session-logout (1.29 KB, patch)
2012-07-22 10:55 CEST , Nick Schermer
no flags
Fix unattended in xfce4-panel (1.65 KB, patch)
2012-07-22 11:14 CEST , Nick Schermer
no flags
Read SaveOnExit in xfsm_manager_save_yourself_global (857 bytes, patch)
2012-07-22 11:19 CEST , Nick Schermer
no flags

Additional information