API to bring down the session

Bug #1302213 reported by Ted Gould
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity-mir (Ubuntu)
Invalid
Undecided
Unassigned
unity8 (Ubuntu)
Fix Released
Critical
Ying-Chun Liu

Bug Description

<blue sky>
For the desktop session we need a way to tell Unity to signal all the apps that they should do a final save, shut them off, do it's own final save and start bringing down the session.
</blue sky>

<reality>
There's not time for that, and we need to get something that won't paint us into a corner, but yet allows for getting to the blue sky above eventually. For today we just need a way for people to get out of their session so they can get their desktop back to LightDM without powering off.

What I'm proposing is that we add a function to the Unity DBus API for "RequestSessionShutdown" that indicator-session can call. Today that function can just call "exit(0)" and be done with it. In the future the blue sky above can be implemented.
</reality>

Related branches

Ted Gould (ted)
Changed in unity8:
assignee: nobody → Michał Sawicz (saviq)
Revision history for this message
Michał Sawicz (saviq) wrote :

How does it happen in unity7 atm?

Revision history for this message
Ted Gould (ted) wrote :

In Unity7 we talk to gnome-session who brings everything down gracefully (talks to apps, etc.).

Revision history for this message
Michał Sawicz (saviq) wrote :

Looks like we want to implement an interface somewhat close to gnome-session (there's ongoing work on an fdo spec for that, though). Let's start with Logout on /com/canonical/Unity/.

Changed in unity8:
status: New → Triaged
importance: Undecided → High
assignee: Michał Sawicz (saviq) → Ying-Chun Liu (paulliu)
Michał Sawicz (saviq)
Changed in unity8:
status: Triaged → In Progress
Revision history for this message
Michał Sawicz (saviq) wrote :

Hey, so we need the signal to:

* emit a aboutToQuit signal so that unity8 can prepare
* send "stop" to upstart for all apps
* wait for upstart to report all apps shut down
* send a quit signal to unity8

Unity8 should block the UI (darken/show a spinner?) on aboutToQuit, and call QApplication::quit() on quit from unity-mir.

Changed in unity-mir (Ubuntu):
status: New → In Progress
Revision history for this message
Ted Gould (ted) wrote : Re: [Bug 1302213] Re: API to bring down the session

On Thu, 2014-04-10 at 14:24 +0000, Michał Sawicz wrote:

> * emit a aboutToQuit signal so that unity8 can prepare
> * send "stop" to upstart for all apps
> * wait for upstart to report all apps shut down
> * send a quit signal to unity8

Do we need a step in there to tell the focused app to save its session?
The backgrounded ones should have already, but the one in focused one
would need that.

Revision history for this message
Michał Sawicz (saviq) wrote :

> Do we need a step in there to tell the focused app to save its session?
> The backgrounded ones should have already, but the one in focused one
> would need that.

See bug #1304257 - we'll be sending that to running apps to let them to their job. But it's not available yet.

Revision history for this message
kevin gunn (kgunn72) wrote :

sorry to mark this one critical.
urgency is that this is tied to the unity8-desktop-session in that people need to be able to log-out of the unity8 session and back into unity7.

Changed in unity8:
importance: High → Critical
Revision history for this message
Michał Sawicz (saviq) wrote :

There's one thing that just came to mind... if unity8 is started as an upstart job, it exiting won't really result in anything special... it will get respawned... Need to take that into account.

Revision history for this message
Ted Gould (ted) wrote :

On Tue, 2014-04-15 at 18:54 +0000, Michał Sawicz wrote:

> There's one thing that just came to mind... if unity8 is started as an
> upstart job, it exiting won't really result in anything special... it
> will get respawned... Need to take that into account.

If it exits normally it won't get respawned, only if it exits with
error. You can change which codes those are in the upstart job config.

Revision history for this message
Ying-Chun Liu (paulliu) wrote :
Revision history for this message
Charles Kerr (charlesk) wrote :

FWIW, I think that this will "just work" in indicator-session as soon as the unity side's code merges. Treviño did a nice patch at http://bazaar.launchpad.net/~indicator-applet-developers/indicator-session/trunk.14.04/revision/445 that checks the bus for busname "com.canonical.Unity" and object path "/com/canonical/Unity/Session"; and if found, prefers to call the unity API over the older session API.

Even better, Treviño's patch landed pre-14.04 so things should work correctly regardless of whether you're testing on Trusty or Utopic. :)

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

This bug was fixed in the package unity8 - 7.89+14.10.20140624-0ubuntu1

---------------
unity8 (7.89+14.10.20140624-0ubuntu1) utopic; urgency=low

  [ Ying-Chun Liu ]
  * Add logout support. Reviewed by: Daniel d'Andrada (LP: #1302213)
 -- Ubuntu daily release <email address hidden> Tue, 24 Jun 2014 08:17:09 +0000

Changed in unity8 (Ubuntu):
status: New → Fix Released
Michał Sawicz (saviq)
Changed in unity8:
status: In Progress → Fix Released
Changed in unity-mir (Ubuntu):
status: In Progress → Invalid
Michał Sawicz (saviq)
Changed in unity8 (Ubuntu):
assignee: nobody → Ying-Chun Liu (paulliu)
importance: Undecided → Critical
no longer affects: unity8
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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