[Xfce-bugs] [Bug 7324] New: Xfce4-session should ensure that essential processes are started

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Mon Feb 21 01:07:21 CET 2011


http://bugzilla.xfce.org/show_bug.cgi?id=7324

           Summary: Xfce4-session should ensure that essential processes
                    are started
    Classification: Xfce
           Product: Xfce4-session
           Version: 4.8.0
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: Medium
         Component: General
        AssignedTo: xfce-bugs at xfce.org
        ReportedBy: ambrop7 at gmail.com
         QAContact: bjt23 at cornell.edu
                CC: benny at xfce.org


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.

-- 
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Xfce-bugs mailing list