mtp

Merge lp:~ogra/mtp/fix-upstart-handling into lp:mtp

Proposed by Oliver Grawert
Status: Superseded
Proposed branch: lp:~ogra/mtp/fix-upstart-handling
Merge into: lp:mtp
Diff against target: 89 lines (+13/-34)
5 files modified
debian/changelog (+8/-0)
debian/mtp-server.conf (+5/-7)
debian/mtp-server.install (+0/-1)
debian/mtp-server.mtp-state.upstart (+0/-18)
debian/rules (+0/-8)
To merge this branch: bzr merge lp:~ogra/mtp/fix-upstart-handling
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve
PS Jenkins bot continuous-integration Approve
Ricardo Salveti (community) Approve
Review via email: mp+252574@code.launchpad.net

This proposal has been superseded by a proposal from 2015-03-11.

Commit message

fix the upstart job of mtp-server to make it start again

drop all mtp-state handling, we start/stop the server directly from udev events via the usb-service shipped in lxc-android-config now

Description of the change

fix the upstart job of mtp-server to make it start again

drop all mtp-state handling, we start/stop the server directly from udev events via the usb-service shipped in lxc-android-config now

To post a comment you must log in.
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

I took a glance at the lxc-android-config and it seems like a neat approach.

And given that there are start and stop stanzas there, do we need upstart jobs at all here?

Also, since I can't review lxc-android-config; there seems to be no locking and wait_for_greeter blocks for mtp at least, so you might have a situation of multiple calls causing races. Should be lock/mutex the binary call?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

LGTM, will test and then top approve.

review: Approve
lp:~ogra/mtp/fix-upstart-handling updated
67. By Oliver Grawert

also remove mtp-state.conf from mtp-server.install

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Looks good to me too.

review: Approve

Unmerged revisions

67. By Oliver Grawert

also remove mtp-state.conf from mtp-server.install

66. By Oliver Grawert

fix the upstart job of mtp-server to make it start at all again, drop mtp-state, this is handled differently now

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-02-19 19:56:15 +0000
3+++ debian/changelog 2015-03-11 14:55:55 +0000
4@@ -1,3 +1,11 @@
5+mtp (0.0.4+15.04.20150219-0ubuntu2) UNRELEASED; urgency=medium
6+
7+ * fix the upstart job of mtp-server to make it start again
8+ * drop all mtp-state handling, we start/stop the server directly from udev
9+ events via the usb-service shipped in lxc-android-config now
10+
11+ -- Oliver Grawert <ogra@ubuntu.com> Wed, 11 Mar 2015 13:34:14 +0100
12+
13 mtp (0.0.4+15.04.20150219-0ubuntu1) vivid; urgency=medium
14
15 [ Mathieu Trudel-Lapierre ]
16
17=== modified file 'debian/mtp-server.conf'
18--- debian/mtp-server.conf 2015-02-13 16:00:49 +0000
19+++ debian/mtp-server.conf 2015-03-11 14:55:55 +0000
20@@ -1,16 +1,14 @@
21 description "MTP protocol server"
22
23-start on :sys:android-usb-connected or android-usb-connected or :sys:android-mtp-on or android-mtp-on or started unity8
24-stop on :sys:android-usb-disconnected or android-usb-disconnected or :sys:android-mtp-off or android-mtp-off or desktop-end
25+start on :sys:android-usb-connected or android-usb-connected or started unity8
26+stop on :sys:android-usb-disconnected or android-usb-disconnected or desktop-end
27
28 pre-start script
29 [ "$USER" != "lightdm" ] || { stop; exit 0; }
30
31- disconnected=`grep -c DISCONNECTED /sys/devices/virtual/android_usb/android0/state`;
32- if [ -z "$disconnected" ] || [ "$disconnected" -ge 1 ];
33- then
34- stop; exit 0;
35- fi
36+ test -e /sys/devices/virtual/android_usb/android0/state || { stop; exit 0; }
37+ grep -q DISCONNECTED /sys/devices/virtual/android_usb/android0/state && { stop; exit 0; }
38+ grep -q mtp /sys/devices/virtual/android_usb/android0/functions || { stop; exit 0; }
39
40 # Fix for bug LP: #1389223: UnityGreeter isn't available immediately
41 if ! dbus-send --session --print-reply \
42
43=== modified file 'debian/mtp-server.install'
44--- debian/mtp-server.install 2015-01-20 00:54:30 +0000
45+++ debian/mtp-server.install 2015-03-11 14:55:55 +0000
46@@ -1,4 +1,3 @@
47 usr/bin/mtp-server
48 usr/share/locale
49 debian/mtp-server.conf /usr/share/upstart/sessions/
50-debian/mtp-state.conf /usr/share/upstart/sessions/
51
52=== removed file 'debian/mtp-server.mtp-state.upstart'
53--- debian/mtp-server.mtp-state.upstart 2014-03-07 19:11:20 +0000
54+++ debian/mtp-server.mtp-state.upstart 1970-01-01 00:00:00 +0000
55@@ -1,18 +0,0 @@
56-start on android-container persist.sys.usb.config=* and started lightdm
57-
58-task
59-
60-emits android-mtp-on
61-emits android-mtp-off
62-
63-script
64- VAL=$(env | grep persist.sys.usb.config=)
65- case ${VAL##*=} in
66- mtp*)
67- /sbin/initctl emit android-mtp-on
68- ;;
69- *)
70- /sbin/initctl emit android-mtp-off
71- ;;
72- esac
73-end script
74
75=== modified file 'debian/rules'
76--- debian/rules 2015-01-20 00:54:30 +0000
77+++ debian/rules 2015-03-11 14:55:55 +0000
78@@ -7,11 +7,3 @@
79
80 %:
81 dh $@ --with translations -- --fail-missing
82-
83-override_dh_installinit:
84- dh_installinit -pmtp-server --name=mtp-state --no-start -r -n
85- dh_installinit
86-
87-override_dh_install:
88- cp debian/mtp-server.mtp-state.upstart debian/mtp-state.conf
89- dh_install

Subscribers

People subscribed via source and target branches