Merge lp://staging/~ted/libindicator/upstart-no-dbus into lp://staging/libindicator/13.10

Proposed by Ted Gould
Status: Work in progress
Proposed branch: lp://staging/~ted/libindicator/upstart-no-dbus
Merge into: lp://staging/libindicator/13.10
Diff against target: 294 lines (+29/-152)
2 files modified
libindicator/indicator-ng.c (+6/-67)
libindicator/indicator-service-manager.c (+23/-85)
To merge this branch: bzr merge lp://staging/~ted/libindicator/upstart-no-dbus
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Indicator Applet Developers Pending
Review via email: mp+166269@code.staging.launchpad.net

Commit message

When running under Upstart session let Upstart manage the service.

Description of the change

When we're running under upstart we want upstart to manage the process lifecycle for the service, not the panel-service. This patch makes it so that when we have an upstart session there isn't any dbus activation attempted. Long term we should be able to assume Upstart user session (default on Saucy) and remove the checking code, but let's keep things usable on Raring for now.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Lars Karlitski (larsu) wrote :

I think having the panel (or anything in the session) being aware of the init daemon is inside-out architecture.

Will every service now have to ship with an upstart script in addition to the dbus service file it already has? That adds an unnecessary dependency, and makes it harder to write services.

Why don't we make upstart aware of dbus activation? (I believe I heard it already is, or will be in the near future?) This will bring us all the benefits of upstart managing the services without any extra work.

Are there any advantages to using upstart explicitly?

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

On Wed, 2013-05-29 at 15:51 +0000, Lars Uebernickel wrote:

> I think having the panel (or anything in the session) being aware of
> the init daemon is inside-out architecture.

It's not the init daemon in this case. It's the session manager. It's
like being aware that there is a gnome-session.

> Will every service now have to ship with an upstart script in addition
> to the dbus service file it already has? That adds an unnecessary
> dependency, and makes it harder to write services.

No, there'll be no reason to ship a dbus service file.

> Why don't we make upstart aware of dbus activation? (I believe I heard
> it already is, or will be in the near future?) This will bring us all
> the benefits of upstart managing the services without any extra work.
>
> Are there any advantages to using upstart explicitly?

There was a patch for that, it was rejected upstream, we may put it back
in Ubuntu. But, even with that using Upstart jobs is better for
indicators. It keeps the log files in a single file that is
automatically picked up by apport and attached to bugs. Upstart can
restart the service including retry intervals. And for developers they
can manage when the service stops and starts with external tools that
already exist.

Revision history for this message
Lars Karlitski (larsu) wrote :

> On Wed, 2013-05-29 at 15:51 +0000, Lars Uebernickel wrote:
>
> > I think having the panel (or anything in the session) being aware of
> > the init daemon is inside-out architecture.
>
> It's not the init daemon in this case. It's the session manager. It's
> like being aware that there is a gnome-session.

Right. But I don't see why it should be aware of the session service, either.

> > Will every service now have to ship with an upstart script in addition
> > to the dbus service file it already has? That adds an unnecessary
> > dependency, and makes it harder to write services.
>
> No, there'll be no reason to ship a dbus service file.
>
> > Why don't we make upstart aware of dbus activation? (I believe I heard
> > it already is, or will be in the near future?) This will bring us all
> > the benefits of upstart managing the services without any extra work.
> >
> > Are there any advantages to using upstart explicitly?
>
> There was a patch for that, it was rejected upstream, we may put it back
> in Ubuntu. But, even with that using Upstart jobs is better for
> indicators. It keeps the log files in a single file that is
> automatically picked up by apport and attached to bugs. Upstart can
> restart the service including retry intervals. And for developers they
> can manage when the service stops and starts with external tools that
> already exist.

All of these things will be true anyway, because upstart *is* managing the services.

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

On Wed, 2013-05-29 at 16:18 +0000, Lars Uebernickel wrote:

> All of these things will be true anyway, because upstart *is* managing
> the services.

I guess, but I'm not sure why you're concerned over the job
configuration having:

  start on dbus-activation com.canonical.indicator.network

versus

  start on indicators-loaded

It seems like the second one is clearer and can be managed more easily
as we'll be able to introspect the startup with things like initctl2dot.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
492. By Ted Gould

Don't make the service manager do DBus activation in the Upstart session case.

493. By Ted Gould

Merging trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Lars Karlitski (larsu) wrote :

> On Wed, 2013-05-29 at 16:18 +0000, Lars Uebernickel wrote:
>
> > All of these things will be true anyway, because upstart *is* managing
> > the services.
>
>
> I guess, but I'm not sure why you're concerned over the job
> configuration having:
>
> start on dbus-activation com.canonical.indicator.network
>
> versus
>
> start on indicators-loaded
>
> It seems like the second one is clearer and can be managed more easily
> as we'll be able to introspect the startup with things like initctl2dot.

My point is that the first one won't be needed. Upstart should just take control over all dbus-activated things in the session.

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

On Thu, 2013-05-30 at 12:17 +0000, Lars Uebernickel wrote:

> My point is that the first one won't be needed. Upstart should just
> take control over all dbus-activated things in the session.

I don't think that it'll "take over" all of them because my
understanding is that for Upstart, dbus activation is an event type not
a job.

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

At the end of the day, it comes down to upstart being a process manager. Sure, we could use dbus activation, but then the panel service becomes the process manager. Let's leave process management to a tool that is designed to do that job (and does it well).

494. By Ted Gould

Only build the calcelable if we've got a name

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
495. By Ted Gould

Update to trunk

496. By Ted Gould

Kill the restart code

497. By Ted Gould

Remove the callback

498. By Ted Gould

Assume Upstart in the manager code

499. By Ted Gould

Drop the restartarting the service code

500. By Ted Gould

Don't unwatch on error, we still want to watch for a new one starting

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I object to this. upstart is not mandatory to manage desktop session on ubuntu. And indicators are used on the desktop sessions which are not managed by upstart. At the moment upstart as a user session manager, is opt-in, not opt-out on per session type as defined in /etc/upstart-xsessions. Thus one should preserve dbus activation files.

I understand the desire to have dbus services be managed/respawned by upstart the session manager, but forcing that to happen is not the right solution.

Unmerged revisions

500. By Ted Gould

Don't unwatch on error, we still want to watch for a new one starting

499. By Ted Gould

Drop the restartarting the service code

498. By Ted Gould

Assume Upstart in the manager code

497. By Ted Gould

Remove the callback

496. By Ted Gould

Kill the restart code

495. By Ted Gould

Update to trunk

494. By Ted Gould

Only build the calcelable if we've got a name

493. By Ted Gould

Merging trunk

492. By Ted Gould

Don't make the service manager do DBus activation in the Upstart session case.

491. By Ted Gould

Don't start the service when we're under the Upstart session

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches