Merge lp:~3v1n0/bamf/upstart-support into lp:bamf

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: 651
Merged at revision: 621
Proposed branch: lp:~3v1n0/bamf/upstart-support
Merge into: lp:bamf
Prerequisite: lp:~ci-train-bot/bamf/bamf-ubuntu-xenial-landing-011
Diff against target: 64 lines (+20/-5)
4 files modified
data/Makefile.am (+10/-2)
data/bamfdaemon-dbus-runner.in (+7/-0)
data/bamfdaemon.conf.in (+2/-2)
data/org.ayatana.bamf.service.in (+1/-1)
To merge this branch: bzr merge lp:~3v1n0/bamf/upstart-support
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+276865@code.launchpad.net

Commit message

BamfDaemon: add upstart session support

To post a comment you must log in.
lp:~3v1n0/bamf/upstart-support updated
649. By Marco Trevisan (Treviño)

BamfDaemon: add upstart support

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~3v1n0/bamf/upstart-support updated
650. By Marco Trevisan (Treviño)

data: add bamfdaemon-dbus-runner, to run the daemon using upstart if possible

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~3v1n0/bamf/upstart-support updated
651. By Marco Trevisan (Treviño)

bamfdaemon: make start/stop depending on hud and unity-panel-service

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Nice.

review: Approve
Revision history for this message
Martin Pitt (pitti) wrote :

This adds quite a lot of complexity and potential for brittleness. You already had a followup fix for bamfdaemon-dbus-runner.in, having this redirector is quite ugly, and it assumes that the start condition

  start on (starting hud or starting unity-panel-service or starting unity7)

is correct and complete for all times. I. e. if someone tries to use bamf under Ubuntu GNOME, you will get 25s D-Bus timeouts.

D-Bus activation starts up the service *exactly* when and if it's needed, provides automatic restarts, and avoids all of this.

What was the rationale for this? It would be nice if commit logs would explain the "why", not (just) the "what". Thanks!

Revision history for this message
Martin Pitt (pitti) wrote :

To be precise, I think we should drop data/bamfdaemon-dbus-runner.in and data/bamfdaemon.conf.in completely.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

As explained in IRC, my POV was to ensure bamf is running with the same environment variables we had in unity, plus ensuring it to be respawn when killed or crashed, without having to directly call a dbus method (that for the way libbamf is done, might happen late, or only on user actions).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/Makefile.am'
--- data/Makefile.am 2015-11-19 10:23:37 +0000
+++ data/Makefile.am 2015-11-19 10:23:38 +0000
@@ -4,14 +4,22 @@
4upstartdir = @datarootdir@/upstart/sessions4upstartdir = @datarootdir@/upstart/sessions
5upstart_DATA = bamfdaemon.conf5upstart_DATA = bamfdaemon.conf
66
7bamfdaemondbusrunnerdir = $(pkglibexecdir)
8bamfdaemondbusrunner_SCRIPTS = bamfdaemon-dbus-runner
9
7org.ayatana.bamf.service: org.ayatana.bamf.service.in10org.ayatana.bamf.service: org.ayatana.bamf.service.in
8 $(AM_V_GEN)sed "s,@PKGLIBEXECDIR@,$(pkglibexecdir)," $< > $@11 $(AM_V_GEN)sed "s,@PKGLIBEXECDIR@,$(pkglibexecdir)," $< > $@
912
10bamfdaemon.conf: bamfdaemon.conf.in13bamfdaemon.conf: bamfdaemon.conf.in
11 $(AM_V_GEN)sed "s,@PKGLIBEXECDIR@,$(pkglibexecdir)," $< > $@14 $(AM_V_GEN)sed "s,@PKGLIBEXECDIR@,$(pkglibexecdir)," $< > $@
1215
16bamfdaemon-dbus-runner: bamfdaemon-dbus-runner.in
17 $(AM_V_GEN)sed "s,@PKGLIBEXECDIR@,$(pkglibexecdir)," $< > $@
18
13EXTRA_DIST = org.ayatana.bamf.service.in \19EXTRA_DIST = org.ayatana.bamf.service.in \
14 bamfdaemon.conf.in20 bamfdaemon.conf.in \
21 bamfdaemon-dbus-runner.in
1522
16CLEANFILES = org.ayatana.bamf.service \23CLEANFILES = org.ayatana.bamf.service \
17 bamfdaemon.conf24 bamfdaemon.conf \
25 bamfdaemon-dbus-runner
1826
=== added file 'data/bamfdaemon-dbus-runner.in'
--- data/bamfdaemon-dbus-runner.in 1970-01-01 00:00:00 +0000
+++ data/bamfdaemon-dbus-runner.in 2015-11-19 10:23:38 +0000
@@ -0,0 +1,7 @@
1#!/bin/bash
2
3if [ -n "$UPSTART_SESSION" ]; then
4 /sbin/initctl start bamfdaemon
5else
6 @PKGLIBEXECDIR@/bamfdaemon
7fi
08
=== modified file 'data/bamfdaemon.conf.in'
--- data/bamfdaemon.conf.in 2015-11-19 10:23:37 +0000
+++ data/bamfdaemon.conf.in 2015-11-19 10:23:38 +0000
@@ -1,8 +1,8 @@
1description "BAMF Application Matcher Framework"1description "BAMF Application Matcher Framework"
2author "Marco Trevisan <marco.trevisan@canonical.com>"2author "Marco Trevisan <marco.trevisan@canonical.com>"
33
4start on starting unity74start on (starting hud or starting unity-panel-service or starting unity7)
5stop on stopped unity75stop on (stopped hud and stopped unity-panel-service and stopped unity7)
66
7respawn7respawn
8exec @PKGLIBEXECDIR@/bamfdaemon8exec @PKGLIBEXECDIR@/bamfdaemon
99
=== modified file 'data/org.ayatana.bamf.service.in'
--- data/org.ayatana.bamf.service.in 2012-11-07 19:51:56 +0000
+++ data/org.ayatana.bamf.service.in 2015-11-19 10:23:38 +0000
@@ -1,3 +1,3 @@
1[D-BUS Service]1[D-BUS Service]
2Name=org.ayatana.bamf2Name=org.ayatana.bamf
3Exec=@PKGLIBEXECDIR@/bamfdaemon3Exec=@PKGLIBEXECDIR@/bamfdaemon-dbus-runner

Subscribers

People subscribed via source and target branches