You are not logged in.

#1 2012-07-11 17:03:40

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Problem with systemd and ipad/ipod/iphone

When I boot using systemd, and then attempt to query a ipad, ipod, or iphone, I get the following:

$ ideviceinfo 
usbmuxd_get_device_list: error opening socket!
No device found, is it plugged in?

Interestingly, if I boot using sysv (Arch default) init, ideviceinfo is able to connect to the devices with no problems.  I am clearly missing something...but what smile

$ ls /etc/systemd/system/multi-user.target.wants
cpupower.service    gpm.service         ntpd.service      remote-fs.target   ufw.service
cronie.service      lm_sensors.service  psd.service       smbd.service
fancontrol.service  network.service     rc-local.service  syslog-ng.service

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2012-07-12 03:07:35

crondog
Member
Registered: 2011-04-21
Posts: 130

Re: Problem with systemd and ipad/ipod/iphone

I have just noticed this too (havent used my ipad in a while) I dont have sysv to test though.

I have managed to get it working if i run "sudo usbmuxd"

If i run as a normal user

usbmuxd -vv -f output
[13:04:04.569][3] usbmuxd v1.0.8-3-g13bcf78 starting up
[13:04:04.570][0] Could not open lockfile

It looks like /etc/udev.rules.d/85-usbmuxd.rules is not being run since this is the output of ps after i plug in my ipad and not running usbmuxd manually...

ps aux | grep usbmuxd
jon       1742  0.0  0.0   8424  1080 pts/0    S+   13:07   0:00 grep --color=auto -i usbmuxd

EDIT
It also appears that ideviceinfo only like usbmuxd being run as root

sudo /usr/sbin/usbmuxd -U root
ideviceinfo

works

However

sudo /usr/sbin/usbmuxd -U crondog
ideviceinfo

doesnt work

Last edited by crondog (2012-07-12 03:35:40)

Offline

#3 2012-07-12 23:38:58

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Problem with systemd and ipad/ipod/iphone

Regardless of the udev rule, simply running ` ideviceinfo` fails to connect under systemd but does under sysv.

Something else I noticed is that syncing an ipod or ipad or iphone under a vm (virtualbox) FAILS under systemd after 1-2 min of file transfers when the host system is booted via systemd.  In contrast, all 1000+ songs in my wife's library are able to sync in the vm when the host system is booted under sysv.  This sucks because systemd is SO much faster; I would like to continue using it and need to figure this out hmm


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2012-07-13 02:51:32

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: Problem with systemd and ipad/ipod/iphone

@graysky: interesting. I'm surprised this has not cropped up earlier. With the most recent udev (if booted under systemd), udev rules are forbidden from starting long-running daemons (this was always discouraged, but now they are actually killed). Sadly, this is exactly what usbmuxd does, so udev kills it. When using sysvinit, udev does not do this killing.

Simple solution: create a systemd unit that just starts usbmuxd unconditionally on boot.

Proper solution: create a systemd unit file to wrap around usbmuxd; and change the udev rule to not have any RUN directive. Instead add a "systemd tag" in the udev rule. This will create a .device systemd unit for your usb device. You can then tell systemd to start the usbmuxd service whenever such a device appears.

Better: take this upstream to usbmuxd.

Offline

#5 2012-07-14 05:33:46

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Problem with systemd and ipad/ipod/iphone

@tomegun - I will follow-up with upstream.  Can you provide me with some specifics regarding your 'proper solution'?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2012-07-18 00:48:00

nekonekno
Member
From: Mexico, D.F.
Registered: 2012-05-05
Posts: 3
Website

Re: Problem with systemd and ipad/ipod/iphone

I tried without success put an usbmuxd.service... My experience with systemd is not so deep and I'm scared by the possibility of mess up my system(d). I'm wondering for the proper solution, too. big_smile


Post mortem nihil est, ipsaue mors nihil.

Offline

#7 2012-07-18 11:08:31

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: Problem with systemd and ipad/ipod/iphone

@graysky: sorry, didn't see your message.

Have a look in 99-systemd.rules for examples. I suggest you replace the first udev rule in 85-usbmuxd.rules with

------------------>8-----------------------------
# Forces iDevices to the last USB configuration and runs usbmuxd
ACTION=="add", SUBSYSTEM=="usb", OWNER="usbmux", ATTR{idVendor}=="05ac", ATTR{idProduct}=="12[9a][0-9a-f]", ENV{USBMUX_SUPPORTED}="1", ATTR{bConfigurationValue}!="$attr{bNumConfigurations}", ATTR{bConfigurationValue}="$attr{bNumConfigurations}", TAG+="systemd", ENV{SYSTEMD_WANTS}="usbmuxd.service"
------------------>8-----------------------------

* the TAG means that the device will appear as a .device to systemd
* the ENV means that usbmuxd.service will be started when this device appears.

As to the service file (usbmuxd.service):

------------------>8-----------------------------
[Unit]
Description=USB Multiplex Daemon

[Service]
User=usbmux
ExecStart=/usr/sbin/usbmuxd -u -f
------------------>8-----------------------------

* I have not checked if using User=usbmux works, in case it does not one would have to append "-U usbmux" to the ExecStart line instead
* the '-u' is necessary if you want the udev rule on unplug to shut down the daemon (I'd probably be inclined to just leave the daemon running and delete the "remove" rule, unless it is known to cause wakeups or other bad behavior even when there are no devices. This is how most other daemons work.)
* the '-f' is needed to stay in the foreground to let systemd know what is the main process and keep track of it when it is shutdown (e.g. by a call to 'usbmuxd -x')

Offline

#8 2012-07-18 11:24:29

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: Problem with systemd and ipad/ipod/iphone

This is already being discussed on the libimobiledevice list. I added a few suggestions there, and I hope it will land in git soon (at which time I'll make sure to backport it).

Offline

#9 2012-10-18 16:28:07

t0ken
Member
Registered: 2012-06-29
Posts: 29

Re: Problem with systemd and ipad/ipod/iphone

I've followed the suggestions of tomegun but still haven't got this to work correctly w/systemd.  Has anyone got this working properly?  In the meantime, I have to start usbmuxd manually as root whenever I want to connect to my iphone.

Offline

Board footer

Powered by FluxBB