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
1=== modified file 'data/Makefile.am'
2--- data/Makefile.am 2015-11-19 10:23:37 +0000
3+++ data/Makefile.am 2015-11-19 10:23:38 +0000
4@@ -4,14 +4,22 @@
5 upstartdir = @datarootdir@/upstart/sessions
6 upstart_DATA = bamfdaemon.conf
7
8+bamfdaemondbusrunnerdir = $(pkglibexecdir)
9+bamfdaemondbusrunner_SCRIPTS = bamfdaemon-dbus-runner
10+
11 org.ayatana.bamf.service: org.ayatana.bamf.service.in
12 $(AM_V_GEN)sed "s,@PKGLIBEXECDIR@,$(pkglibexecdir)," $< > $@
13
14 bamfdaemon.conf: bamfdaemon.conf.in
15 $(AM_V_GEN)sed "s,@PKGLIBEXECDIR@,$(pkglibexecdir)," $< > $@
16
17+bamfdaemon-dbus-runner: bamfdaemon-dbus-runner.in
18+ $(AM_V_GEN)sed "s,@PKGLIBEXECDIR@,$(pkglibexecdir)," $< > $@
19+
20 EXTRA_DIST = org.ayatana.bamf.service.in \
21- bamfdaemon.conf.in
22+ bamfdaemon.conf.in \
23+ bamfdaemon-dbus-runner.in
24
25 CLEANFILES = org.ayatana.bamf.service \
26- bamfdaemon.conf
27+ bamfdaemon.conf \
28+ bamfdaemon-dbus-runner
29
30=== added file 'data/bamfdaemon-dbus-runner.in'
31--- data/bamfdaemon-dbus-runner.in 1970-01-01 00:00:00 +0000
32+++ data/bamfdaemon-dbus-runner.in 2015-11-19 10:23:38 +0000
33@@ -0,0 +1,7 @@
34+#!/bin/bash
35+
36+if [ -n "$UPSTART_SESSION" ]; then
37+ /sbin/initctl start bamfdaemon
38+else
39+ @PKGLIBEXECDIR@/bamfdaemon
40+fi
41
42=== modified file 'data/bamfdaemon.conf.in'
43--- data/bamfdaemon.conf.in 2015-11-19 10:23:37 +0000
44+++ data/bamfdaemon.conf.in 2015-11-19 10:23:38 +0000
45@@ -1,8 +1,8 @@
46 description "BAMF Application Matcher Framework"
47 author "Marco Trevisan <marco.trevisan@canonical.com>"
48
49-start on starting unity7
50-stop on stopped unity7
51+start on (starting hud or starting unity-panel-service or starting unity7)
52+stop on (stopped hud and stopped unity-panel-service and stopped unity7)
53
54 respawn
55 exec @PKGLIBEXECDIR@/bamfdaemon
56
57=== modified file 'data/org.ayatana.bamf.service.in'
58--- data/org.ayatana.bamf.service.in 2012-11-07 19:51:56 +0000
59+++ data/org.ayatana.bamf.service.in 2015-11-19 10:23:38 +0000
60@@ -1,3 +1,3 @@
61 [D-BUS Service]
62 Name=org.ayatana.bamf
63-Exec=@PKGLIBEXECDIR@/bamfdaemon
64+Exec=@PKGLIBEXECDIR@/bamfdaemon-dbus-runner

Subscribers

People subscribed via source and target branches