! 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 !
Xfce4-session should ensure that essential processes are started
Status:
RESOLVED: DUPLICATE
Product:
Xfce4-session
Component:
General

Comments

Description Ambroz Bizjak 2011-02-21 01:07:20 CET
Currently, xfce4-session starts up somehow like that:
- if the session file is missing, it reads xfce4-session.xml and executes the programs specified
- if the session file is present, it executes the programs specified there, and does not consult xfce4-session.xml

This is not a good way for starting essential processes (window manager, panel, desktop), because it may happen that an essential processes is not started.

For example, if, when logging out, an essential processes fails to save itself, the session manager may forget about it. This has happened to me with xfwm4: when logging out, it seemed that xfwm4 failed to save itself and the session manager timed out, forgetting about xfwm4. This way xfwm4 was not started on next login.

Another (hypothetical) example is if, starting with no session file, an essential process crashes at initialization before it manages to contact the session manager. In this case the session manager will not even know about the process - it will not attempt to restart it, and will not start it on next login.

I have a proposal on how the session manager could attempt to ensure that essential processes are always started. I can implement it, but please provide feedback.

1.
Remove the "failsafe session" from xfce4-session.xml. Instead, xfce4-session.xml contains a list of so-called services. Each service has a command for starting it. This command requests the service to use a given client ID (with a substitution like %c) (e.g. xfwm4 --sm-client-id=%c). Each service also has a unique name.

2.
When the session manager determines to start a service in a fresh state (e.g. with no session file), it generates a new client ID, than starts the service process, passing it the new client ID (see 1.). The service process then (hopefully?) connects to the session manager using the given client ID. This way the session manager recognizes that client as belonging to a particular service.

3.
On log out, the session manager requests all clients to save themselves, then saves restore info into the session file. However, when saving the info of a client that belonged to a service, it also saves the unique service name.

4.
When the session manager starts up, it goes through all the services in xfce4-session.xml. For each service, it checks if there is a client in the session file belonging to that service. If there is, it will start the service using the information in the session file. If there is none, it will start it as described in (2.).

The net result of this is that if an essential process for some reason disappears from the session file, it will still be started on login, and e.g. the user will not be left without a window manager.

I expect these modifications to require relatively little changes to the source code of the session manager.
Comment 1 Nick Schermer editbugs 2011-02-21 07:53:27 CET
And what is someone wants to start a session with no panel?
Comment 2 Ambroz Bizjak 2011-02-21 10:37:21 CET
(In reply to comment #1)
> And what is someone wants to start a session with no panel?

He copies the system-installed xfce4-session.xml to his local xfce configuration and removes the entry for the panel.

This will however affect all sessions. It could be done per-session by e.g. manually specifying a key to in session file to use a different xfce4-session.xml (name only, e.g. xfce4-session-nopanel).
Comment 3 Ciprian Ciubotariu 2011-10-02 17:02:12 CEST
I am experiencing a similar problem on two different Gentoo amd64 computers.

The list of restored apps seems random. Also KDE apps are never restored (in my case, yakuake, kopete and konversation).

How can I help debug and/or workaround this?
Comment 4 Lionel Le Folgoc 2012-11-12 19:47:02 CET

*** This bug has been marked as a duplicate of bug 828 ***

Bug #7324

Reported by:
Ambroz Bizjak
Reported on: 2011-02-21
Last modified on: 2012-11-12

People

Assignee:
Xfce Bug Triage
CC List:
5 users

Version

Attachments

Additional information