Skip to content

Commit

Permalink
udev: Handle all events only once
Browse files Browse the repository at this point in the history
This fixes spontaneous USB reconfiguration causing "remove" event to be sent to
the daemon, which causes it to close itself if it did not have enough time to
connect to phone.
  • Loading branch information
Blefish authored and nikias committed Jan 31, 2018
1 parent 7f54d30 commit b888970
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions udev/39-usbmuxd.rules.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# usbmuxd (Apple Mobile Device Muxer listening on /var/run/usbmuxd)

# systemd should receive all events relating to device
SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*", TAG+="systemd"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*", TAG+="systemd"

# Initialize iOS devices into "deactivated" USB configuration state and activate usbmuxd
SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*", ACTION=="add", ENV{USBMUX_SUPPORTED}="1", ATTR{bConfigurationValue}="0", OWNER="usbmux", @udev_activation_rule@
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*", ACTION=="add", ENV{USBMUX_SUPPORTED}="1", ATTR{bConfigurationValue}="0", OWNER="usbmux", @udev_activation_rule@

# Exit usbmuxd when the last device is removed
SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*", ACTION=="remove", RUN+="@sbindir@/usbmuxd -x"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*", ACTION=="remove", RUN+="@sbindir@/usbmuxd -x"

0 comments on commit b888970

Please sign in to comment.