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
=== modified file 'debian/changelog'
--- debian/changelog 2015-02-19 19:56:15 +0000
+++ debian/changelog 2015-03-11 14:55:55 +0000
@@ -1,3 +1,11 @@
1mtp (0.0.4+15.04.20150219-0ubuntu2) 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
7 -- Oliver Grawert <ogra@ubuntu.com> Wed, 11 Mar 2015 13:34:14 +0100
8
1mtp (0.0.4+15.04.20150219-0ubuntu1) vivid; urgency=medium9mtp (0.0.4+15.04.20150219-0ubuntu1) vivid; urgency=medium
210
3 [ Mathieu Trudel-Lapierre ]11 [ Mathieu Trudel-Lapierre ]
412
=== modified file 'debian/mtp-server.conf'
--- debian/mtp-server.conf 2015-02-13 16:00:49 +0000
+++ debian/mtp-server.conf 2015-03-11 14:55:55 +0000
@@ -1,16 +1,14 @@
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 disconnected=`grep -c DISCONNECTED /sys/devices/virtual/android_usb/android0/state`;9 test -e /sys/devices/virtual/android_usb/android0/state || { stop; exit 0; }
10 if [ -z "$disconnected" ] || [ "$disconnected" -ge 1 ];10 grep -q DISCONNECTED /sys/devices/virtual/android_usb/android0/state && { stop; exit 0; }
11 then11 grep -q mtp /sys/devices/virtual/android_usb/android0/functions || { stop; exit 0; }
12 stop; exit 0;
13 fi
1412
15 # Fix for bug LP: #1389223: UnityGreeter isn't available immediately13 # Fix for bug LP: #1389223: UnityGreeter isn't available immediately
16 if ! dbus-send --session --print-reply \14 if ! dbus-send --session --print-reply \
1715
=== modified file 'debian/mtp-server.install'
--- debian/mtp-server.install 2015-01-20 00:54:30 +0000
+++ debian/mtp-server.install 2015-03-11 14:55:55 +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-11 14:55:55 +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