Merge lp:~serge-hallyn/ubuntu/precise/bluez/bluez-respawn into lp:ubuntu/precise/bluez

Proposed by Serge Hallyn
Status: Merged
Merged at revision: 85
Proposed branch: lp:~serge-hallyn/ubuntu/precise/bluez/bluez-respawn
Merge into: lp:ubuntu/precise/bluez
Diff against target: 37 lines (+11/-1)
2 files modified
debian/bluez.bluetooth.upstart (+3/-1)
debian/changelog (+8/-0)
To merge this branch: bzr merge lp:~serge-hallyn/ubuntu/precise/bluez/bluez-respawn
Reviewer Review Type Date Requested Status
Evan Broder (community) Needs Fixing
Ubuntu branches Pending
Review via email: mp+95667@code.launchpad.net

Description of the change

This is a resubmission (with changelog entry added) of https://code.launchpad.net/~pali/ubuntu/precise/bluez/bluez/+merge/92660.

I believe the current handling of the BLUETOOTH_ENABLED=0 case is a bug (it should stop and exit 0, not exit 1). I'm hoping that is enough to allow it to be applied during precise cycle :)

To post a comment you must log in.
Revision history for this message
Evan Broder (broder) wrote :

Steve Langasek provided some strong feedback that /etc/default files shouldn't be used just to enable/disable Upstart jobs. Instead, we should use Upstart override files. (The other two variables in /etc/default/bluetooth are not currently being used for anything)

To smooth out the upgrade path, I suggested checking the value of BLUETOOTH_ENABLED and creating /etc/init/bluetooth.override if necessary to disable the job.

I've pushed the partial completion of my work to <https://code.launchpad.net/~broder/ubuntu/precise/bluez/bluez-respawn/>, however it is incomplete. The prerm file needs to undo what the preinst did if it gets called with abort-upgrade. In order to do this, it needs to know if the preinst created the file in the first place.

So if the preinst creates/modifies the override file, it needs to also create a flag file, which the prerm can use to determine whether or not to rollback the override file. The postrm also should clean up this file. And all of this should be conditionalized on the upgrade version.

I'm planning to finish up the work here and upload it, but at present I'm getting kicked out of my coffee shop so I'll have to do it later. Since I'm committing to taking care of this, I'm going to go ahead and remove this and the original MP from the sponsorship queue by setting them to "Work in Progress"; I'll change them to "Merged" once I'm finished.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/bluez.bluetooth.upstart'
2--- debian/bluez.bluetooth.upstart 2012-01-24 11:31:04 +0000
3+++ debian/bluez.bluetooth.upstart 2012-03-02 20:41:19 +0000
4@@ -9,6 +9,7 @@
5 env RFCOMM_CONF=/etc/bluetooth/rfcomm.conf
6
7 expect fork
8+respawn
9
10 exec /usr/sbin/bluetoothd
11
12@@ -17,7 +18,8 @@
13
14 if [ "$BLUETOOTH_ENABLED" = "0" ];
15 then
16- exit 1
17+ stop
18+ exit 0
19 fi
20 end script
21
22
23=== modified file 'debian/changelog'
24--- debian/changelog 2012-02-22 10:51:07 +0000
25+++ debian/changelog 2012-03-02 20:41:19 +0000
26@@ -1,3 +1,11 @@
27+bluez (4.98-2ubuntu2) precise; urgency=low
28+
29+ [ Pali Rohár ]
30+ * Respawn bluetooth daemon if crashed, and do the right thing when
31+ BLUETOOTH_ENABLED=0.
32+
33+ -- Serge Hallyn <serge.hallyn@ubuntu.com> Fri, 02 Mar 2012 14:34:54 -0600
34+
35 bluez (4.98-2ubuntu1) precise; urgency=low
36
37 * Merge with Debian unstable. Remaining Ubuntu changes:

Subscribers

People subscribed via source and target branches

to all changes: