mtp

Merge lp:~phablet-team/mtp/fix-upstart-handling into lp:mtp

Proposed by Ricardo Salveti
Status: Merged
Approved by: Ricardo Salveti
Approved revision: 69
Merge reported by: Mathieu Trudel-Lapierre
Merged at revision: not available
Proposed branch: lp:~phablet-team/mtp/fix-upstart-handling
Merge into: lp:mtp
Diff against target: 85 lines (+12/-30)
5 files modified
debian/changelog (+10/-0)
debian/mtp-server.conf (+2/-3)
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:~phablet-team/mtp/fix-upstart-handling
Reviewer Review Type Date Requested Status
Ricardo Salveti (community) Approve
Mathieu Trudel-Lapierre Pending
PS Jenkins bot continuous-integration Pending
Review via email: mp+252658@code.launchpad.net

This proposal supersedes 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 : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Ricardo Salveti (rsalveti) wrote : Posted in a previous version of this proposal

LGTM, will test and then top approve.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote : Posted in a previous version of this proposal

Looks good to me too.

review: Approve
Revision history for this message
Ricardo Salveti (rsalveti) :
review: Approve
69. By Ricardo Salveti

Adding again removed blank line from previous merge

70. By Oliver Grawert

drop th DISCONNECTED check from the upstart job

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2015-03-11 19:36:38 +0000
+++ debian/changelog 2015-03-19 13:20:48 +0000
@@ -1,3 +1,13 @@
1mtp (0.0.4+15.04.20150219-0ubuntu3) UNRELEASED; urgency=medium
2
3 * fix the upstart job of mtp-server to make it start again
4 * drop all mtp-state handling, we start/stop the server directly from udev
5 events via the usb-service shipped in lxc-android-config now
6 * drop "DISCONNECTED" check, we are on manual anyway with the upstart job,
7 only udev rules or explicit session jobs will trigger it.
8
9 -- Oliver Grawert <ogra@ubuntu.com> Wed, 11 Mar 2015 13:34:14 +0100
10
1mtp (0.0.4+15.04.20150219-0ubuntu2) vivid; urgency=medium11mtp (0.0.4+15.04.20150219-0ubuntu2) vivid; urgency=medium
212
3 * Properly fixing the startup script, as the previous change broke13 * Properly fixing the startup script, as the previous change broke
414
=== modified file 'debian/mtp-server.conf'
--- debian/mtp-server.conf 2015-03-11 19:35:22 +0000
+++ debian/mtp-server.conf 2015-03-19 13:20:48 +0000
@@ -1,13 +1,12 @@
1description "MTP protocol server"1description "MTP protocol server"
22
3start on :sys:android-usb-connected or android-usb-connected or :sys:android-mtp-on or android-mtp-on or started unity83start on :sys:android-usb-connected or android-usb-connected or started unity8
4stop on :sys:android-usb-disconnected or android-usb-disconnected or :sys:android-mtp-off or android-mtp-off or desktop-end4stop on :sys:android-usb-disconnected or android-usb-disconnected or desktop-end
55
6pre-start script6pre-start script
7 [ "$USER" != "lightdm" ] || { stop; exit 0; }7 [ "$USER" != "lightdm" ] || { stop; exit 0; }
88
9 test -e /sys/devices/virtual/android_usb/android0/state || { stop; exit 0; }9 test -e /sys/devices/virtual/android_usb/android0/state || { stop; exit 0; }
10 grep -q DISCONNECTED /sys/devices/virtual/android_usb/android0/state && { stop; exit 0; }
11 grep -q mtp /sys/devices/virtual/android_usb/android0/functions || { stop; exit 0; }10 grep -q mtp /sys/devices/virtual/android_usb/android0/functions || { stop; exit 0; }
1211
13 # Fix for bug LP: #1389223: UnityGreeter isn't available immediately12 # Fix for bug LP: #1389223: UnityGreeter isn't available immediately
1413
=== modified file 'debian/mtp-server.install'
--- debian/mtp-server.install 2015-01-20 00:54:30 +0000
+++ debian/mtp-server.install 2015-03-19 13:20:48 +0000
@@ -1,4 +1,3 @@
1usr/bin/mtp-server1usr/bin/mtp-server
2usr/share/locale2usr/share/locale
3debian/mtp-server.conf /usr/share/upstart/sessions/3debian/mtp-server.conf /usr/share/upstart/sessions/
4debian/mtp-state.conf /usr/share/upstart/sessions/
54
=== removed file 'debian/mtp-server.mtp-state.upstart'
--- debian/mtp-server.mtp-state.upstart 2014-03-07 19:11:20 +0000
+++ debian/mtp-server.mtp-state.upstart 1970-01-01 00:00:00 +0000
@@ -1,18 +0,0 @@
1start on android-container persist.sys.usb.config=* and started lightdm
2
3task
4
5emits android-mtp-on
6emits android-mtp-off
7
8script
9 VAL=$(env | grep persist.sys.usb.config=)
10 case ${VAL##*=} in
11 mtp*)
12 /sbin/initctl emit android-mtp-on
13 ;;
14 *)
15 /sbin/initctl emit android-mtp-off
16 ;;
17 esac
18end script
190
=== modified file 'debian/rules'
--- debian/rules 2015-01-20 00:54:30 +0000
+++ debian/rules 2015-03-19 13:20:48 +0000
@@ -7,11 +7,3 @@
77
8%:8%:
9 dh $@ --with translations -- --fail-missing9 dh $@ --with translations -- --fail-missing
10
11override_dh_installinit:
12 dh_installinit -pmtp-server --name=mtp-state --no-start -r -n
13 dh_installinit
14
15override_dh_install:
16 cp debian/mtp-server.mtp-state.upstart debian/mtp-state.conf
17 dh_install

Subscribers

People subscribed via source and target branches

to all changes: