Open BalkanMadman opened 1 year ago
It turns out the commit https://github.com/libimobiledevice/usbmuxd/commit/e55e6e7c6cdcd7954de339be286b3818da69cddd didn't actually fix the problem.
I investigated this a bit further and found that the problem may be in one of the functions in https://github.com/libimobiledevice/usbmuxd/blob/master/src/usb.c. I don't remember which one exactly; the corresponding logs will be attached later. So, there are two issues with the current handling of udev activation:
usbmuxd
is a daemon — a long living process — and udev
manpage especially discourages starting daemons with RUN
attribute (this is what is done on non-systemd builds). Being unconditionally killed may be the reason why it freezes.usbmuxd
code, i.e. there is a bug.To deal with 1. we need to provide the actual OpenRC service file and implement udev activation via it. I've already done, so wait for the draft PR shortly after the publication of this comment. The other part of the issue needs to be traced down though.
The issue on the Gentoo bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=910706
Gentoo GNU/Linux. I suppose it is because of some kind of data race when it gets executed twice in a very short amount of time. Relevant code snippet from udev rule:
The latter follows the former almost immediately, causing some kind of a data race (I guess).
Got it working by applying the next fix (simply removed the run part when device is added):