void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.59k stars 2.15k forks source link

USB tethering not working, might be due to a bug in 'usbmux' package. #34458

Closed austinrojers closed 2 years ago

austinrojers commented 2 years ago

Expected behaviour

The package should enable USB tether and other functionalities of an iPhone in Linux.

Actual behaviour

I have been trying to connect to my iPhone for USB tethering, but no matter what, Void Linux won't detect it. https://i.imgur.com/yaWaqYm.png It has always worked in all other Linux distros without any issues, and I am using it in my Garuda and Ubuntu installation daily.

I have also added usbmuxd to /var/service. But no matter what, the usbmuxd service won't start on boot.

Here's my console output of sudo sv status /var/service/* https://pastebin.com/NFduFczx

I even tried: sudo sv restart usbmuxd & sudo sv up usbmuxd

But it won't work

I also have libimobiledevice and ifuse installed.

Steps to reproduce the behaviour

You can check it by connecting an iPhone through USB and trying USB tethering/USB hotspot.

ghost commented 2 years ago

I have also added usbmuxd to /var/service. But no matter what, the usbmuxd service won't start on boot.

This is what you were supposed to do, Austin.

But no matter what, the usbmuxd service won't start on boot.

I may assume that your problem is the following: you are unable to start usbmuxd; this is cause.

Inability for the running system to detect your device in the way you expect it is effect.

Given what is in the output of sv status, the problem is on your side.

I had tried to reproduce the issue by installing the package in question and symlinking it to the runsvdir; the daemon runs and operates.

Could you please provide the output of usbmuxd -f -u by executing it as root from your terminal (i.e. using sudo or doas)?

Do not forget to stop the service by running sv stop usbmuxd (also as root) before doing this, just in case.

Example of the output:

# sudo usbmuxd -f -u

[00:00:00.003][3] usbmuxd v1.1.1 starting up
[00:00:00.003][3] Using libusb 1.0.24
[00:00:00.006][3] Initialization complete
[00:00:00.006][3] Automatic device discovery on hotplug disabled.
[00:00:00.006][3] Enabled exit on SIGUSR1 if no devices are attached. Start a new instance with "--exit" to trigger.
austinrojers commented 2 years ago

Thanks a lot for replying.

Magically, today after I read your reply, I just plugged in my iPhone to my laptop. And it simply worked; after all these days! I think a recent update fixed it?

Today I am pleased with Void Linux, my iPhone issue got resolved, and my cinnamon got updated! πŸ˜ƒ

Have a great day ahead!

ghost commented 2 years ago

Glad to see it working.

Feel free to reopen this issue if the problem occurs again.

austinrojers commented 2 years ago

Hello there again!

Feel free to reopen this issue if the problem occurs again.

I think you knew this would happen again right?

Yesterday usbmuxd was up and running, and I could do USB tethering, file transfers and all that. It still worked after a couple of reboots too. Today when I powered on my laptop and plugged in my iPhone, it again shows the same issue. Now we know that it at least works & you are right about this, I suppose:

I may assume that your problem is the following: you are unable to start usbmuxd; this is the cause.

As you had previously requested:

❯ sudo sv status usbmuxd
down: usbmuxd: 503s, normally up
❯ sudo sv restart usbmuxd
timeout: down: usbmuxd: 0s, normally up, want up
❯ sudo sv stop usbmuxd
ok: down: usbmuxd: 1s, normally up, want up
❯ sudo usbmuxd -f -u
[08:40:01.670][3] usbmuxd v1.1.1 starting up
[08:40:01.670][3] Another instance is already running (pid 798). Telling it to check for devices.
[08:40:01.670][3] Sending signal SIGUSR2 to instance with pid 798

Another instance is already running (pid 798). Telling it to check for devices.

I am confused here.

Thank you

ghost commented 2 years ago

I think you knew this would happen again right?

Miracles never happen.

Another instance is already running (pid 798). Telling it to check for devices.

Meaning that another instance of usbmuxd is operating with the process id 798.

Most likely this process was executed by something else on your system bypassing runit (scripts, your desktop environment, "magic utils" and so on).

I would suggest to see where this process comes from (you are lucky if PID 798 has a "tree" of superseding processes) and eliminate it.

ps, htop, and other process monitoring tools may help you to find this PID.

austinrojers commented 2 years ago

@dotnetfox, please have a look here

sudo usbmuxd -f -u
[11:19:13.159][3] usbmuxd v1.1.1 starting up
[11:19:13.159][3] Another instance is already running (pid 778). Telling it to check for devices.
[11:19:13.159][3] Sending signal SIGUSR2 to instance with pid 778

image

image

Now, what should I do?

Thank you

ghost commented 2 years ago

No luck, it forked from the running process.

I can certainly state that /usr/bin/usbmuxd --user usbmux --udev has no relation to runit at all.

As you can observe, all processes running under runsvdir are supervised under runsv and do not fork to the background.

I do not know what is running on your machine, but now you have to find what is running it.

For now try to kill it using sudo kill -9 778; if the process reappears, there is a chance that our "virtue" may be lurking in the processes list, so finding it may be worth.

If you are uncertain or could not find the cause, try the empiric method: boot your system without running Xorg (with display manager if you have it) as example.

Edit: the reason behind this suggestion is that your desktop environment like GANOOOME or kde may employ their "autostart" scripts which haunt users. It is useless to speculate unless your setup is known, including running processes.

At last, you can send your list of processes here (ps -aef --forest). If you have something sensitive running, you can email its output to me (email address can be found in my profile).

austinrojers commented 2 years ago

The moment I kill /usr/bin/usbmuxd --user usbmux --udev everything works. But /usr/bin/usbmuxd --user usbmux --udev again starts after reboot, and I have to kill it again.

Rest I will try and let you know later, I have some work to do.

Thank you πŸ˜ƒ

austinrojers commented 2 years ago

Has it anything to do with usbmux being the USER in the first pic I have shared above.

ghost commented 2 years ago

Has it anything to do with usbmux being the USER in the first pic I have shared above.

It seems that usbmux as user does not have permission to listen for connections, that is all.

The user itself has nothing to do with your problem, just the source of your problems seems to be able to run as root (but not likely, I do not know what is running on your machine), granting possibility to run other utilities and drop privileges.

austinrojers commented 2 years ago

image

❯ ps -aef --forest
UID        PID  PPID  C STIME TTY          TIME CMD
root         2     0  0 12:16 ?        00:00:00 [kthreadd]
root         3     2  0 12:16 ?        00:00:00  \_ [rcu_gp]
root         4     2  0 12:16 ?        00:00:00  \_ [rcu_par_gp]
root         6     2  0 12:16 ?        00:00:00  \_ [kworker/0:0H-events_highpri
root         8     2  0 12:16 ?        00:00:00  \_ [mm_percpu_wq]
root         9     2  0 12:16 ?        00:00:00  \_ [rcu_tasks_kthre]
root        10     2  0 12:16 ?        00:00:00  \_ [rcu_tasks_rude_]
root        11     2  0 12:16 ?        00:00:00  \_ [rcu_tasks_trace]
root        12     2  0 12:16 ?        00:00:00  \_ [ksoftirqd/0]
root        13     2  0 12:16 ?        00:00:08  \_ [rcu_sched]
root        14     2  0 12:16 ?        00:00:00  \_ [migration/0]
root        15     2  0 12:16 ?        00:00:00  \_ [idle_inject/0]
root        17     2  0 12:16 ?        00:00:00  \_ [cpuhp/0]
root        18     2  0 12:16 ?        00:00:00  \_ [cpuhp/1]
root        19     2  0 12:16 ?        00:00:00  \_ [idle_inject/1]
root        20     2  0 12:16 ?        00:00:00  \_ [migration/1]
root        21     2  0 12:16 ?        00:00:00  \_ [ksoftirqd/1]
root        23     2  0 12:16 ?        00:00:00  \_ [kworker/1:0H-events_highpri
root        24     2  0 12:16 ?        00:00:00  \_ [cpuhp/2]
root        25     2  0 12:16 ?        00:00:00  \_ [idle_inject/2]
root        26     2  0 12:16 ?        00:00:00  \_ [migration/2]
root        27     2  0 12:16 ?        00:00:00  \_ [ksoftirqd/2]
root        29     2  0 12:16 ?        00:00:00  \_ [kworker/2:0H-events_highpri
root        30     2  0 12:16 ?        00:00:00  \_ [cpuhp/3]
root        31     2  0 12:16 ?        00:00:00  \_ [idle_inject/3]
root        32     2  0 12:16 ?        00:00:00  \_ [migration/3]
root        33     2  0 12:16 ?        00:00:05  \_ [ksoftirqd/3]
root        35     2  0 12:16 ?        00:00:00  \_ [kworker/3:0H-events_highpri
root        36     2  0 12:16 ?        00:00:00  \_ [kdevtmpfs]
root        37     2  0 12:16 ?        00:00:00  \_ [netns]
root        38     2  0 12:16 ?        00:00:00  \_ [inet_frag_wq]
root        39     2  0 12:16 ?        00:00:00  \_ [kauditd]
root        40     2  0 12:16 ?        00:00:00  \_ [khungtaskd]
root        41     2  0 12:16 ?        00:00:00  \_ [oom_reaper]
root        42     2  0 12:16 ?        00:00:00  \_ [writeback]
root        43     2  0 12:16 ?        00:00:00  \_ [kcompactd0]
root        44     2  0 12:16 ?        00:00:00  \_ [ksmd]
root        45     2  0 12:16 ?        00:00:00  \_ [khugepaged]
root        70     2  0 12:16 ?        00:00:00  \_ [kintegrityd]
root        71     2  0 12:16 ?        00:00:00  \_ [kblockd]
root        72     2  0 12:16 ?        00:00:00  \_ [blkcg_punt_bio]
root        75     2  0 12:16 ?        00:00:00  \_ [edac-poller]
root        76     2  0 12:16 ?        00:00:00  \_ [devfreq_wq]
root        77     2  0 12:16 ?        00:00:00  \_ [watchdogd]
root        80     2  0 12:16 ?        00:00:01  \_ [kworker/0:1H-events_highpri
root        81     2  0 12:16 ?        00:00:00  \_ [kswapd0]
root        82     2  0 12:16 ?        00:00:00  \_ [kthrotld]
root        83     2  0 12:16 ?        00:00:00  \_ [irq/122-aerdrv]
root        84     2  0 12:16 ?        00:00:00  \_ [irq/123-aerdrv]
root        85     2  0 12:16 ?        00:00:00  \_ [irq/124-aerdrv]
root        86     2  0 12:16 ?        00:00:00  \_ [nvme-wq]
root        87     2  0 12:16 ?        00:00:00  \_ [nvme-reset-wq]
root        88     2  0 12:16 ?        00:00:00  \_ [nvme-delete-wq]
root        91     2  0 12:16 ?        00:00:00  \_ [mld]
root        92     2  0 12:16 ?        00:00:00  \_ [ipv6_addrconf]
root        95     2  0 12:16 ?        00:00:01  \_ [kworker/3:1H-events_highpri
root       103     2  0 12:16 ?        00:00:00  \_ [kstrp]
root       104     2  0 12:16 ?        00:00:00  \_ [zswap-shrink]
root       106     2  0 12:16 ?        00:00:00  \_ [charger_manager]
root       331     2  0 12:16 ?        00:00:00  \_ [card0-crtc0]
root       332     2  0 12:16 ?        00:00:00  \_ [card0-crtc1]
root       333     2  0 12:16 ?        00:00:00  \_ [card0-crtc2]
root       358     2  0 12:16 ?        00:00:01  \_ [kworker/2:1H-events_highpri
root       445     2  0 12:16 ?        00:00:00  \_ [ata_sff]
root       446     2  0 12:16 ?        00:00:00  \_ [cryptd]
root       455     2  0 12:16 ?        00:00:00  \_ [scsi_eh_0]
root       457     2  0 12:16 ?        00:00:00  \_ [scsi_tmf_0]
root       459     2  0 12:16 ?        00:00:00  \_ [scsi_eh_1]
root       461     2  0 12:16 ?        00:00:00  \_ [scsi_tmf_1]
root       490     2  0 12:16 ?        00:00:01  \_ [kworker/1:1H-kblockd]
root       557     2  0 12:16 ?        00:00:00  \_ [btrfs-worker]
root       558     2  0 12:16 ?        00:00:00  \_ [btrfs-worker-hi]
root       559     2  0 12:16 ?        00:00:00  \_ [btrfs-delalloc]
root       560     2  0 12:16 ?        00:00:00  \_ [btrfs-flush_del]
root       561     2  0 12:16 ?        00:00:00  \_ [btrfs-cache]
root       562     2  0 12:16 ?        00:00:00  \_ [btrfs-fixup]
root       563     2  0 12:16 ?        00:00:00  \_ [btrfs-endio]
root       564     2  0 12:16 ?        00:00:00  \_ [btrfs-endio-met]
root       565     2  0 12:16 ?        00:00:00  \_ [btrfs-endio-met]
root       566     2  0 12:16 ?        00:00:00  \_ [btrfs-endio-rai]
root       567     2  0 12:16 ?        00:00:00  \_ [btrfs-rmw]
root       568     2  0 12:16 ?        00:00:00  \_ [btrfs-endio-wri]
root       569     2  0 12:16 ?        00:00:00  \_ [btrfs-freespace]
root       570     2  0 12:16 ?        00:00:00  \_ [btrfs-delayed-m]
root       571     2  0 12:16 ?        00:00:00  \_ [btrfs-readahead]
root       572     2  0 12:16 ?        00:00:00  \_ [btrfs-qgroup-re]
root       573     2  0 12:16 ?        00:00:00  \_ [btrfs-cleaner]
root       574     2  0 12:16 ?        00:00:03  \_ [btrfs-transacti]
root       738     2  0 12:16 ?        00:00:00  \_ [tpm_dev_wq]
root       744     2  0 12:16 ?        00:00:00  \_ [acpi_thermal_pm]
root       757     2  0 12:16 ?        00:00:00  \_ [cfg80211]
root       766     2  0 12:16 ?        00:00:00  \_ [ath10k_wq]
root       767     2  0 12:16 ?        00:00:00  \_ [ath10k_aux_wq]
root       768     2  0 12:16 ?        00:00:00  \_ [ath10k_tx_compl]
root       769     2  0 12:16 ?        00:00:00  \_ [irq/51-DELL078B]
root       779     2  0 12:16 ?        00:00:00  \_ [kmemstick]
root       809     2  0 12:16 ?        00:00:00  \_ [irq/133-i2c_hid]
root       847     2  0 12:16 ?        00:00:00  \_ [jbd2/sda8-8]
root       848     2  0 12:16 ?        00:00:00  \_ [ext4-rsv-conver]
root       850     2  0 12:16 ?        00:00:00  \_ [jbd2/sda7-8]
root       851     2  0 12:16 ?        00:00:00  \_ [ext4-rsv-conver]
root     11982     2  0 14:51 ?        00:00:00  \_ [kworker/1:2-events]
root     25231     2  0 15:26 ?        00:00:02  \_ [kworker/0:0-events]
root      6419     2  0 16:01 ?        00:00:00  \_ [kworker/u8:0-btrfs-endio]
root      9422     2  0 16:10 ?        00:00:06  \_ [kworker/u9:3-i915_flip]
root     19223     2  0 16:37 ?        00:00:01  \_ [kworker/3:0-events]
root     20423     2  0 16:40 ?        00:00:00  \_ [kworker/0:1-events]
root     20927     2  0 16:42 ?        00:00:00  \_ [kworker/u9:0-btrfs-worker-h
root     21783     2  0 16:43 ?        00:00:00  \_ [kworker/2:2-events]
root     21882     2  0 17:31 ?        00:00:00  \_ [kworker/2:3-mm_percpu_wq]
root     21883     2  0 17:31 ?        00:00:00  \_ [kworker/3:4-events]
root     21924     2  0 17:31 ?        00:00:00  \_ [kworker/u8:56-events_power_
root     22109     2  0 17:31 ?        00:00:00  \_ [kworker/u8:65-btrfs-endio]
root     22122     2  0 17:31 ?        00:00:00  \_ [irq/129-mei_me]
root     27323     2  0 17:43 ?        00:00:00  \_ [kworker/1:1-mm_percpu_wq]
root     27367     2  0 17:43 ?        00:00:00  \_ [kworker/u8:1-btrfs-endio-wr
root     27368     2  0 17:43 ?        00:00:00  \_ [kworker/u8:2-btrfs-endio-wr
root     28329     2  0 17:47 ?        00:00:00  \_ [kworker/0:2-events]
root     28962     2  0 17:48 ?        00:00:00  \_ [kworker/u9:1-btrfs-worker-h
root     29106     2  0 17:48 ?        00:00:00  \_ [kworker/1:0-mm_percpu_wq]
root     29428     2  0 17:48 ?        00:00:00  \_ [kworker/2:0]
root         1     0  0 12:16 ?        00:00:00 runit
root       875     1  0 12:16 ?        00:00:02 runsvdir -P /run/runit/runsvdir/
root       881   875  0 12:16 ?        00:00:00  \_ runsv NetworkManager
root       907   881  0 12:16 ?        00:00:05  |   \_ NetworkManager -n
root       882   875  0 12:16 ?        00:00:00  \_ runsv acpid
root       898   882  0 12:16 ?        00:00:00  |   \_ acpid -f -l
root       883   875  0 12:16 ?        00:00:00  \_ runsv agetty-hvc0
root     29399   883  0 17:48 ?        00:00:00  |   \_ agetty -L hvc0 9600 vt10
root       884   875  0 12:16 ?        00:00:00  \_ runsv agetty-hvsi0
root     29397   884  0 17:48 ?        00:00:00  |   \_ agetty -L -8 hvsi0 19200
root       885   875  0 12:16 ?        00:00:00  \_ runsv dbus
dbus       890   885  0 12:16 ?        00:00:05  |   \_ dbus-daemon --system --n
root       886   875  0 12:16 ?        00:00:00  \_ runsv elogind
root       891   886  0 12:16 ?        00:01:06  |   \_ /usr/libexec/elogind/elo
root       887   875  0 12:16 ?        00:00:00  \_ runsv polkitd
polkitd    908   887  0 12:16 ?        00:00:04  |   \_ /usr/lib/polkit-1/polkit
root       888   875  0 12:16 ?        00:00:00  \_ runsv rtkit
rtkit     1016   888  0 12:16 ?        00:00:00  |   \_ /usr/libexec/rtkit-daemo
root       889   875  0 12:16 ?        00:00:00  \_ runsv sshd
root       909   889  0 12:16 ?        00:00:00  |   \_ sshd: /usr/bin/sshd -D [
root       895   875  0 12:16 ?        00:00:00  \_ runsv uuidd
_uuidd     903   895  0 12:16 ?        00:00:00  |   \_ uuidd -F -P
root       899   875  0 12:16 ?        00:00:00  \_ runsv cupsd
root       901   899  0 12:16 ?        00:00:00  |   \_ cupsd -f
root       900   875  0 12:16 ?        00:00:00  \_ runsv dhcpcd
root       902   900  0 12:16 ?        00:00:07  |   \_ dhcpcd: [master] [ip4] [
root       913   875  0 12:16 ?        00:00:00  \_ runsv lightdm
root       914   913  0 12:16 ?        00:00:02  |   \_ lightdm
root     22306   914  2 17:32 tty7     00:00:26  |       \_ /usr/libexec/Xorg :0
root     22865   914  0 17:32 ?        00:00:00  |       \_ lightdm --session-ch
austin   22869 22865  0 17:32 ?        00:00:00  |           \_ cinnamon-session
austin   22890 22869  0 17:32 ?        00:00:00  |               \_ [Xsession] <
austin   22935 22869  0 17:32 ?        00:00:00  |               \_ csd-clipboar
austin   22936 22869  0 17:32 ?        00:00:00  |               \_ csd-screensa
austin   22937 22869  0 17:32 ?        00:00:00  |               \_ csd-media-ke
austin   22939 22869  0 17:32 ?        00:00:06  |               \_ csd-backgrou
austin   22941 22869  0 17:32 ?        00:00:00  |               \_ csd-print-no
austin   22947 22869  0 17:32 ?        00:00:00  |               \_ csd-keyboard
austin   22948 22869  0 17:32 ?        00:00:00  |               \_ csd-xsetting
austin   22949 22869  0 17:32 ?        00:00:00  |               \_ csd-automoun
austin   22952 22869  0 17:32 ?        00:00:00  |               \_ csd-power
austin   22958 22869  0 17:32 ?        00:00:00  |               \_ csd-housekee
austin   22961 22869  0 17:32 ?        00:00:00  |               \_ csd-xrandr
austin   22968 22869  0 17:32 ?        00:00:00  |               \_ csd-a11y-set
austin   22971 22869  0 17:32 ?        00:00:00  |               \_ csd-orientat
austin   22974 22869  0 17:32 ?        00:00:00  |               \_ csd-cursor
austin   22983 22869  0 17:32 ?        00:00:00  |               \_ csd-sound
austin   22988 22869  0 17:32 ?        00:00:00  |               \_ csd-a11y-key
austin   22994 22869  0 17:32 ?        00:00:00  |               \_ csd-mouse
austin   23106 22994  0 17:32 ?        00:00:00  |               |   \_ syndaemo
austin   22995 22869  0 17:32 ?        00:00:00  |               \_ csd-color
austin   23101 22869  0 17:32 ?        00:00:00  |               \_ cinnamon-lau
austin   23110 23101  2 17:32 ?        00:00:22  |               |   \_ cinnamon
austin   23443 23110 26 17:32 ?        00:04:21  |               |       \_ fire
austin   24225 23443  0 17:32 ?        00:00:00  |               |       |   \_ 
austin   24256 23443  1 17:32 ?        00:00:11  |               |       |   \_ 
austin   24359 23443  1 17:32 ?        00:00:16  |               |       |   \_ 
austin   24403 23443  1 17:32 ?        00:00:13  |               |       |   \_ 
austin   24496 23443  0 17:32 ?        00:00:00  |               |       |   \_ 
austin   24862 23443  0 17:33 ?        00:00:00  |               |       |   \_ 
austin   28906 23110  2 17:48 ?        00:00:01  |               |       \_ cinn
austin   23127 22869  0 17:32 ?        00:00:00  |               \_ /usr/libexec
austin   23134 22869  0 17:32 ?        00:00:00  |               \_ /usr/bin/fla
austin   23136 22869  0 17:32 ?        00:00:00  |               \_ /usr/bin/pyt
austin   23138 22869  0 17:32 ?        00:00:00  |               \_ nemo-desktop
austin   23140 22869  0 17:32 ?        00:00:00  |               \_ nm-applet
austin   23143 22869  0 17:32 ?        00:00:01  |               \_ /usr/libexec
austin   23146 22869  0 17:32 ?        00:00:00  |               \_ cinnamon-kil
austin   23147 22869  0 17:32 ?        00:00:00  |               \_ clipit
austin   23159 22869  0 17:32 ?        00:00:00  |               \_ /usr/libexec
root       918   875  0 12:16 ?        00:00:00  \_ runsv agetty-tty1
root       925   918  0 12:16 tty1     00:00:00  |   \_ agetty --noclear tty1 38
root       919   875  0 12:16 ?        00:00:00  \_ runsv agetty-tty2
root       926   919  0 12:16 tty2     00:00:00  |   \_ agetty tty2 38400 linux
root       920   875  0 12:16 ?        00:00:00  \_ runsv agetty-tty3
root       928   920  0 12:16 tty3     00:00:00  |   \_ agetty tty3 38400 linux
root       921   875  0 12:16 ?        00:00:00  \_ runsv agetty-tty4
root       938   921  0 12:16 tty4     00:00:00  |   \_ agetty tty4 38400 linux
root       922   875  0 12:16 ?        00:00:00  \_ runsv agetty-tty5
root       937   922  0 12:16 tty5     00:00:00  |   \_ agetty tty5 38400 linux
root       923   875  0 12:16 ?        00:00:00  \_ runsv agetty-tty6
root       936   923  0 12:16 tty6     00:00:00  |   \_ agetty tty6 38400 linux
root       924   875  0 12:16 ?        00:00:00  \_ runsv udevd
root       927   924  0 12:16 ?        00:00:00  |   \_ udevd
root       932   875  0 12:16 ?        00:00:00  \_ runsv auto-cpufreq
root       941   932  0 12:16 ?        00:00:29  |   \_ /usr/bin/python3 /usr/bi
root       933   875  0 12:16 ?        00:00:00  \_ runsv chronyd
chrony     934   933  0 12:16 ?        00:00:00  |   \_ chronyd -n -u chrony
root       942   875  0 12:16 ?        00:00:00  \_ runsv grub-btrfs
root       945   942  0 12:16 ?        00:00:00  |   \_ vlogger -t grub-btrfs
root       946   942  0 12:16 ?        00:00:00  |   \_ wendy -m 960 -w /.snapsh
root       943   875  0 12:16 ?        00:00:01  \_ runsv usbmuxd
root      6262   943  0 14:37 ?        00:00:00      \_ usbmuxd -f -u
root      1032     1  0 12:17 ?        00:01:40 /usr/libexec/accounts-daemon
root      1054     1  0 12:17 ?        00:00:00 /usr/bin/wpa_supplicant -uq
root      1217     1  0 12:17 ?        00:00:00 /usr/libexec/upowerd
colord    2213     1  0 12:19 ?        00:00:00 /usr/libexec/colord
root      2246     1  0 12:19 ?        00:00:01 /usr/libexec/udisks2/udisksd
austin   22895     1  0 17:32 ?        00:00:00 dbus-launch --exit-with-session 
austin   22896     1  0 17:32 ?        00:00:00 /usr/bin/dbus-daemon --syslog --
austin   22901     1  0 17:32 ?        00:00:00 /usr/libexec/gvfsd
austin   23246 22901  0 17:32 ?        00:00:00  \_ /usr/libexec/gvfsd-afc --spa
austin   23247 22901  0 17:32 ?        00:00:00  \_ /usr/libexec/gvfsd-gphoto2 -
austin   23312 22901  0 17:32 ?        00:00:00  \_ /usr/libexec/gvfsd-trash --s
austin   22906     1  0 17:32 ?        00:00:00 /usr/libexec/gvfsd-fuse /run/use
austin   22908     1  0 17:32 ?        00:00:00 /usr/libexec/at-spi-bus-launcher
austin   22913 22908  0 17:32 ?        00:00:00  \_ /usr/bin/dbus-daemon --confi
austin   22922     1  0 17:32 ?        00:00:00 /usr/libexec/at-spi2-registryd -
austin   22929     1  0 17:32 ?        00:00:00 /usr/bin/gnome-keyring-daemon --
austin   22978     1  0 17:32 ?        00:00:00 /usr/libexec/dconf-service
austin   22992     1  0 17:32 ?        00:00:00 /usr/bin/pulseaudio --start --lo
austin   23085 22992  0 17:32 ?        00:00:00  \_ /usr/libexec/pulse/gsettings
austin   23019     1  0 17:32 ?        00:00:00 /usr/libexec/gvfs-udisks2-volume
austin   23020     1  0 17:32 ?        00:00:00 /usr/libexec/csd-printer
austin   23030     1  0 17:32 ?        00:00:00 /usr/libexec/gvfs-goa-volume-mon
austin   23035     1  0 17:32 ?        00:00:00 /usr/libexec/goa-daemon
austin   23057     1  0 17:32 ?        00:00:00 /usr/libexec/goa-identity-servic
austin   23076     1  0 17:32 ?        00:00:00 /usr/libexec/gvfs-gphoto2-volume
austin   23183     1  0 17:32 ?        00:00:00 cinnamon-slideshow
austin   23227     1  0 17:32 ?        00:00:00 /usr/libexec/gvfs-mtp-volume-mon
austin   23232     1  0 17:32 ?        00:00:00 /usr/libexec/gvfs-afc-volume-mon
austin   23352     1  0 17:32 ?        00:00:00 /usr/libexec/gvfsd-metadata
austin   23453     1  6 17:32 ?        00:01:06 conky -c /home/austin/.harmattan
austin   29126     1  6 17:48 ?        00:00:00 /usr/bin/python3 /usr/bin/termin
austin   29151 29126  2 17:48 pts/0    00:00:00  \_ /bin/zsh
austin   29429 29151  0 17:48 pts/0    00:00:00      \_ ps -aef --forest
austin   29164     1  0 17:48 pts/0    00:00:00 /bin/zsh
austin   29381 29164  0 17:48 pts/0    00:00:00  \_ /home/austin/.cache/gitstatu
austin   29382     1  0 17:48 pts/0    00:00:00 /bin/zsh
austin   29384     1  0 17:48 pts/0    00:00:00 /bin/zsh
austinrojers commented 2 years ago

I booted in recovery mode and there too I got this: image

ghost commented 2 years ago

I booted in recovery mode and there too I got this:

Good way to diagnose, you have my praise (really).

I cannot reproduce this issue, so this is a blind spot here for me.

Looking back at those PIDs, udevd runs first, usbmuxd is the second one and runsvdir is the last.

I suspect that those processes are run before all services are started (before stage 2 of runit or at its beginning), so dbus, elogind and other bloatware are crossed out.

I would suggest to skim through /etc to find whether there are scripts which execute it.

Given that most files there might be protected from reading, try to run grep -r -i "usbmux" /etc with root privileges (i.e. sudo).

You may as well try to grep /var, /usr/share if you are out of luck.

I believe that in /etc or somewhere else is a script that runs your daemon, overriding runsvdir.

austinrojers commented 2 years ago

I think we have found the culprit: (I found it in sudo grep -r -i "usbmux" /var)

  GNU nano 5.9                                                                                                       /usr/lib/udev/rules.d/39-usbmuxd.rules                                                                                                                  
# usbmuxd (Apple Mobile Device Muxer listening on /var/run/usbmuxd)

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

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

# Make sure properties don't get lost when bind action is called
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/8600/*", ACTION=="bind", ENV{USBMUX_SUPPORTED}="1", OWNER="usbmux", RUN+="/usr/bin/usbmuxd --user usbmux --udev"

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

Isn't it a bug in the package? There is systemd mentioned here?πŸ˜• (Edit: please have a look here too-https://github.com/libimobiledevice/usbmuxd/blob/master/udev/39-usbmuxd.rules.in) How shall I proceed now?

Here's my grep output, just in case. Thank You


❯ sudo grep -r -i "usbmux" /etc
/etc/sv/usbmuxd/run:exec usbmuxd -f -u
/etc/passwd-:usbmux:x:986:983:usbmux unprivileged user:/var/lib/lockdown:/sbin/nologin
/etc/shadow-:usbmux:!:18964::::::
/etc/group:usbmux:x:983:
/etc/gshadow:usbmux:!::
/etc/passwd:usbmux:x:986:983:usbmux unprivileged user:/var/lib/lockdown:/sbin/nologin
/etc/shadow:usbmux:!:18964::::::
grep: /etc/ld.so.cache: binary file matches
❯ sudo  grep -r -i "usbmux" /usr/share
grep: /usr/share/locale/as/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/ast/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/be/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/bg/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/bn/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/bn_IN/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/bs/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/ca/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/ca@valencia/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/cs/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/da/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/de/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/el/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/en_GB/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/es/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/et/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/eu/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/fi/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/fr/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/fur/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/gl/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/gu/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/he/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/hi/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/hr/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/hu/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/id/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/it/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/ja/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/kk/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/kn/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/ko/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/lt/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/lv/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/mk/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/ml/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/mr/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/ms/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/nb/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/nl/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/nn/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/oc/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/or/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/pa/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/pl/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/pt/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/pt_BR/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/ro/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/ru/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/sk/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/sl/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/sr/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/sr@latin/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/sv/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/ta/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/te/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/th/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/tr/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/ug/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/uk/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/vi/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/zh_CN/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/zh_HK/LC_MESSAGES/gvfs.mo: binary file matches
grep: /usr/share/locale/zh_TW/LC_MESSAGES/gvfs.mo: binary file matches
/usr/share/man/man1/idevicepair.1:idevicepair \- Manage host pairings with devices and usbmuxd.
/usr/share/man/man1/idevicepair.1:Manage host pairings with devices and usbmuxd.
/usr/share/man/man1/idevicepair.1:print the system buid of the usbmuxd host.
/usr/share/man/man1/inetcat.1:inetcat \- Opens a read/write interface via STDIN/STDOUT to a TCP port on a usbmux device
/usr/share/man/man1/inetcat.1:interface to a TCP port on a usbmux device and exposing it via STDIN/STDOUT.
/usr/share/man/man1/inetcat.1:https://github.com/libimobiledevice/libusbmuxd
/usr/share/man/man1/iproxy.1:iproxy \- A proxy that binds local TCP ports to be forwarded to the specified ports on a usbmux device
/usr/share/man/man1/iproxy.1:the local ports will be forwarded to the specified port (or ports) on a usbmux
/usr/share/man/man1/iproxy.1:https://github.com/libimobiledevice/libusbmuxd
/usr/share/man/man8/usbmuxd.8:.TH "usbmuxd" 8
/usr/share/man/man8/usbmuxd.8:usbmuxd \- Expose a socket to multiplex connections from and to iOS devices.
/usr/share/man/man8/usbmuxd.8:.B usbmuxd
/usr/share/man/man8/usbmuxd.8:usbmuxd stands for "USB multiplexing daemon". This daemon is in charge of
/usr/share/man/man8/usbmuxd.8:means you can connect to any listening localhost socket on the device. usbmuxd
/usr/share/man/man8/usbmuxd.8:When usbmuxd is running (normally started, or stopped as a result of "udev"
/usr/share/man/man8/usbmuxd.8:"/var/run/usbmuxd" that is designed to be compatible with the socket interface
/usr/share/man/man8/usbmuxd.8:You should also create a "usbmux" user that has access to USB devices on your
/usr/share/man/man8/usbmuxd.8:The first usbmuxd daemon implementation was authored by Hector Martin.
/usr/share/man/man8/usbmuxd.8:https://github.com/libimobiledevice/usbmuxd
grep: /usr/share/man/mandoc.db: binary file matches
❯ sudo  grep -r -i "usbmux" /var
/var/db/xbps/.libusbmuxd-files.plist:           <string>/usr/lib/libusbmuxd-2.0.so.6.0.0</string>
/var/db/xbps/.libusbmuxd-files.plist:           <string>/usr/lib/libusbmuxd-2.0.so.6</string>
/var/db/xbps/.libusbmuxd-files.plist:           <string>/usr/lib/libusbmuxd-2.0.so.6.0.0</string>
/var/db/xbps/.usbmuxd-files.plist:          <string>/etc/sv/usbmuxd</string>
/var/db/xbps/.usbmuxd-files.plist:          <string>/etc/sv/usbmuxd/run</string>
/var/db/xbps/.usbmuxd-files.plist:          <string>/usr/bin/usbmuxd</string>
/var/db/xbps/.usbmuxd-files.plist:          <string>/usr/lib/udev/rules.d/39-usbmuxd.rules</string>
/var/db/xbps/.usbmuxd-files.plist:          <string>/usr/share/man/man8/usbmuxd.8</string>
/var/db/xbps/.usbmuxd-files.plist:          <string>/etc/sv/usbmuxd/supervise</string>
/var/db/xbps/.usbmuxd-files.plist:          <string>/run/runit/supervise.usbmuxd</string>
/var/db/xbps/.libusbmuxd-devel-files.plist:         <string>/usr/include/usbmuxd-proto.h</string>
/var/db/xbps/.libusbmuxd-devel-files.plist:         <string>/usr/include/usbmuxd.h</string>
/var/db/xbps/.libusbmuxd-devel-files.plist:         <string>/usr/lib/libusbmuxd-2.0.a</string>
/var/db/xbps/.libusbmuxd-devel-files.plist:         <string>/usr/lib/pkgconfig/libusbmuxd-2.0.pc</string>
/var/db/xbps/.libusbmuxd-devel-files.plist:         <string>/usr/lib/libusbmuxd-2.0.so</string>
/var/db/xbps/.libusbmuxd-devel-files.plist:         <string>/usr/lib/libusbmuxd-2.0.so.6.0.0</string>
/var/db/xbps/pkgdb-0.38.plist:          <string>usbmuxd&gt;=0</string>
/var/db/xbps/pkgdb-0.38.plist:          <string>libusbmuxd&gt;=2.0.2_1</string>
/var/db/xbps/pkgdb-0.38.plist:          <string>libusbmuxd-2.0.so.6</string>
/var/db/xbps/pkgdb-0.38.plist:          <string>libusbmuxd-devel&gt;=0</string>
/var/db/xbps/pkgdb-0.38.plist:  <key>libusbmuxd</key>
/var/db/xbps/pkgdb-0.38.plist:      <string>https://raw.githubusercontent.com/libimobiledevice/libusbmuxd/master/NEWS</string>
/var/db/xbps/pkgdb-0.38.plist:      <string>libusbmuxd</string>
/var/db/xbps/pkgdb-0.38.plist:      <string>libusbmuxd-2.0.2_1</string>
/var/db/xbps/pkgdb-0.38.plist:          <string>libusbmuxd-2.0.so.6</string>
/var/db/xbps/pkgdb-0.38.plist:      <string>libusbmuxd:a9b46a6be5</string>
/var/db/xbps/pkgdb-0.38.plist:  <key>libusbmuxd-devel</key>
/var/db/xbps/pkgdb-0.38.plist:      <string>https://raw.githubusercontent.com/libimobiledevice/libusbmuxd/master/NEWS</string>
/var/db/xbps/pkgdb-0.38.plist:      <string>libusbmuxd-devel</string>
/var/db/xbps/pkgdb-0.38.plist:      <string>libusbmuxd-devel-2.0.2_1</string>
/var/db/xbps/pkgdb-0.38.plist:          <string>libusbmuxd&gt;=2.0.2_1</string>
/var/db/xbps/pkgdb-0.38.plist:      <string>libusbmuxd:a9b46a6be5</string>
/var/db/xbps/pkgdb-0.38.plist:  <key>usbmuxd</key>
/var/db/xbps/pkgdb-0.38.plist:      <string>https://raw.githubusercontent.com/libimobiledevice/usbmuxd/master/NEWS</string>
/var/db/xbps/pkgdb-0.38.plist:      <string>usbmuxd</string>
/var/db/xbps/pkgdb-0.38.plist:      <string>usbmuxd-1.1.1_1</string>
/var/db/xbps/pkgdb-0.38.plist:      <string>usbmuxd:a9b46a6be5</string>
grep: /var/lib/flatpak/repo/objects/15/cbe551ff21067376994f3c2840913004a37734dd5b06e459a0d6eab97b02a1.file: binary file matches
ghost commented 2 years ago

My apologies for the delayed response.

Remove /usr/lib/udev/rules.d/39-usbmuxd.rules for now.

Isn't it a bug in the package? There is systemd mentioned here?

The package itself is built without support for systemd.

If you see any unit files related to systemd - they are there for reference.

ghost commented 2 years ago

@ahesford, the upstream of usbmuxd ships their own rules for udev, thus overriding the service.

Could this be fixed?

ahesford commented 2 years ago
  1. Do NOT remove the udev rule from the package. If it doesn't work as expected, mask it by symlinking /etc/udev/rules.d/39-usbmuxd.rules to /dev/null. You could also add a noextract XBPS rule and reinstall the package, but simply removing the file will break package consistency and your change will be wiped out with the next update anyway.
  2. The purpose of the udev rule is to autostart the daemon when a device is attached and kill it on detach. When this works reliably, you should be able to use your device without constantly running the service. In practice, I've seen the daemon hang occasionally when udev should be killing it, so I manage the daemon with runit. (I've never had the issue of competing instances that you see.) your results might differ. Try disabling the runit service and reattaching your phone. It might "just work", Apple style.

The "systemd" TAG line in the udev rule is a signal to systemd that a device unit should be created when this device is added to the system. Since Void does not have systemd, this should have no significance. In the absence of evidence that the systemd tag declaration actually causes a problem in the udev autostart rule, we should assume it takes no meaningful action and avoid carrying a patch for no purpose.

I am an infrequent user of usbmuxd. While it seems udev management of the daemon is sometimes flaky, I do not believe (but really don't know) that the flakiness is a hard dependence on systemd components that Void does not provide. If I am wrong and proper automatic management of the daemon requires that systemd manage device units, Void should stop shipping a useless udev rule.

austinrojers commented 2 years ago

The purpose of the udev rule is to autostart the daemon when a device is attached and kill it on detach

@ahesford You are right; we should not remove the udev_rule; without this udev-rule, the USB tethering won't work if I remove my device and plug it in again. I verified it by restoring the 39-usbmuxd.rules file from my system snapshot and everything was fine again. But the issue is this udev-rule automatically runs /usr/bin/usbmuxd on boot, thus overriding the usbmuxd service, and nothing would work.

In the absence of evidence that the systemd tag declaration actually causes a problem in the udev autostart rule, we should assume it takes no meaningful action and avoids carrying a patch for no purpose.

As evidence, killing this process /usr/bin/usbmuxd fixes everything.

So I would suggest that since this rule is required, you could edit the part of the rule that autostarts /usr/bin/usbmuxd on boot. I have no knowledge about programming languages, so I have no idea about this.

Please patch this out, so this issue can be resolved; otherwise, I have to kill /usr/bin/usbmuxd every time on boot Thank you

  GNU nano 5.9                                                                                                       /usr/lib/udev/rules.d/39-usbmuxd.rules                                                                                                                  
# usbmuxd (Apple Mobile Device Muxer listening on /var/run/usbmuxd)

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

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

# Make sure properties don't get lost when bind action is called
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/8600/*", ACTION=="bind", ENV{USBMUX_SUPPORTED}="1", OWNER="usbmux", RUN+="/usr/bin/usbmuxd --user usbmux --udev"

# Exit usbmuxd when the last device is removed
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/8600/*", ACTION=="remove", RUN+="/usr/bin/usbmuxd -x"
ahesford commented 2 years ago

There's nothing to "patch out". If the udev rule works as you expect, disable the runit service.

austinrojers commented 2 years ago

Very interesting!! I unlinked /var/service/usbmuxd, rebooted. Still same issues.

❯ sudo usbmuxd -f -u
[19:12:05.194][3] usbmuxd v1.1.1 starting up
[19:12:05.194][3] Another instance is already running (pid 770). Telling it to check for devices.
[19:12:05.194][3] Sending signal SIGUSR2 to instance with pid 770

image

Then I killed PID 770 sudo kill -9 770

Now everything works. (So you don't require usbmuxd service for USB tethering and file transfers)

Then, now I htoped : image

It's very confusing. Now we have the same process running again and everything is working fine.

I still have to kill /usr/bin/usbmuxd on boot for everything to work fine!

@ahesford please have a look.

Thank you

ahesford commented 2 years ago

Why are you starting usbmuxd from the shell? Let udev do its job and start the daemon when your phone is attached.

ghost commented 2 years ago

Why are you starting usbmuxd from the shell? Let udev do its job and start the daemon when your phone is attached.

I believe his point is that usbmuxd starts at phase 2 of runit, yet the phone is not connected. udev does not even kill the process.

After killing the process manually, udev begins to behave: it runs usbmuxd on attach, kills on detach, just like you stated.

austinrojers commented 2 years ago

I believe this is precisely the issue. Thanks @dotnetfox

ahesford commented 2 years ago

Maybe you should install the psmisc package and run pstree -a to see where in the process tree usbmuxd lives. udev shouldn't be starting it until a device is attached, so something else is probably to blame here.

austinrojers commented 2 years ago

@ahesford please have a look at the comments in the beginning because we tried to figure this out earlier.

pstree -a
runit
  β”œβ”€accounts-daemon
  β”‚   └─2*[{accounts-daemon}]
  β”œβ”€at-spi-bus-laun
  β”‚   β”œβ”€dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
  β”‚   └─3*[{at-spi-bus-laun}]
  β”œβ”€at-spi2-registr --use-gnome-session
  β”‚   └─2*[{at-spi2-registr}]
  β”œβ”€cinnamon-slides
  β”‚   └─3*[{cinnamon-slides}]
  β”œβ”€colord
  β”‚   └─2*[{colord}]
  β”œβ”€conky -c /home/austin/.harmattan-themes/Transparent/God-Mode/.conkyrc
  β”‚   └─25*[{conky}]
  β”œβ”€csd-printer
  β”‚   └─2*[{csd-printer}]
  β”œβ”€dbus-daemon --syslog --fork --print-pid 5 --print-address 12 --session
  β”œβ”€dbus-launch --exit-with-session cinnamon-session --session cinnamon
  β”œβ”€dconf-service
  β”‚   └─2*[{dconf-service}]
  β”œβ”€gnome-keyring-d --start --components=ssh
  β”‚   └─3*[{gnome-keyring-d}]
  β”œβ”€goa-daemon
  β”‚   └─3*[{goa-daemon}]
  β”œβ”€goa-identity-se
  β”‚   └─2*[{goa-identity-se}]
  β”œβ”€gvfs-afc-volume
  β”‚   └─3*[{gvfs-afc-volume}]
  β”œβ”€gvfs-goa-volume
  β”‚   └─2*[{gvfs-goa-volume}]
  β”œβ”€gvfs-gphoto2-vo
  β”‚   └─2*[{gvfs-gphoto2-vo}]
  β”œβ”€gvfs-mtp-volume
  β”‚   └─2*[{gvfs-mtp-volume}]
  β”œβ”€gvfs-udisks2-vo
  β”‚   └─3*[{gvfs-udisks2-vo}]
  β”œβ”€gvfsd
  β”‚   β”œβ”€gvfsd-trash --spawner :1.1 /org/gtk/gvfs/exec_spaw/1
  β”‚   β”‚   └─2*[{gvfsd-trash}]
  β”‚   └─2*[{gvfsd}]
  β”œβ”€gvfsd-fuse /run/user/1000/gvfs -f
  β”‚   └─5*[{gvfsd-fuse}]
  β”œβ”€gvfsd-metadata
  β”‚   └─2*[{gvfsd-metadata}]
  β”œβ”€pulseaudio --start --log-target=syslog
  β”‚   β”œβ”€gsettings-helpe
  β”‚   β”‚   └─3*[{gsettings-helpe}]
  β”‚   └─2*[{pulseaudio}]
  β”œβ”€runsvdir -P /run/runit/runsvdir/current...
  β”‚   β”œβ”€runsv NetworkManager
  β”‚   β”‚   └─NetworkManager -n
  β”‚   β”‚       └─2*[{NetworkManager}]
  β”‚   β”œβ”€runsv acpid
  β”‚   β”‚   └─acpid -f -l
  β”‚   β”œβ”€runsv agetty-hvc0
  β”‚   β”‚   └─agetty -L hvc0 9600 vt100
  β”‚   β”œβ”€runsv agetty-hvsi0
  β”‚   β”‚   └─agetty -L -8 hvsi0 19200 vt100
  β”‚   β”œβ”€runsv dbus
  β”‚   β”‚   └─dbus-daemon --system --nofork --nopidfile
  β”‚   β”œβ”€runsv elogind
  β”‚   β”‚   └─elogind
  β”‚   β”œβ”€runsv polkitd
  β”‚   β”‚   └─polkitd --no-debug
  β”‚   β”‚       └─7*[{polkitd}]
  β”‚   β”œβ”€runsv rtkit
  β”‚   β”‚   └─rtkit-daemon
  β”‚   β”‚       └─2*[{rtkit-daemon}]
  β”‚   β”œβ”€runsv sshd
  β”‚   β”‚   └─sshd
  β”‚   β”œβ”€runsv uuidd
  β”‚   β”‚   └─uuidd -F -P
  β”‚   β”œβ”€runsv cupsd
  β”‚   β”‚   └─cupsd -f
  β”‚   β”œβ”€runsv dhcpcd
  β”‚   β”‚   └─dhcpcd
  β”‚   β”œβ”€runsv lightdm
  β”‚   β”‚   └─lightdm
  β”‚   β”‚       β”œβ”€Xorg :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
  β”‚   β”‚       β”‚   └─10*[{Xorg}]
  β”‚   β”‚       β”œβ”€lightdm --session-child 12 19
  β”‚   β”‚       β”‚   β”œβ”€cinnamon-sessio --session cinnamon
  β”‚   β”‚       β”‚   β”‚   β”œβ”€(Xsession)
  β”‚   β”‚       β”‚   β”‚   β”œβ”€cinnamon-killer
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{cinnamon-killer}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€cinnamon-launch
  β”‚   β”‚       β”‚   β”‚   β”‚   β”œβ”€cinnamon --replace
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”œβ”€GeckoMain
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€Privileged Cont -contentproc -childID 1 -isForBrowser -prefsLen 1 -prefMapSize 250958 -jsInitLen 279148 ...
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └─18*[{Privileged Cont}]
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€RDD Process -contentproc -parentBuildID 20211208120426 -prefsLen 8016 -prefMapSize 250958 -appDir ...
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └─2*[{RDD Process}]
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€Web Content -contentproc -childID 2 -isForBrowser -prefsLen 373 -prefMapSize 250958 -jsInitLen 279148 ...
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └─21*[{Web Content}]
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€Web Content -contentproc -childID 4 -isForBrowser -prefsLen 5689 -prefMapSize 250958 -jsInitLen 279148 ...
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └─21*[{Web Content}]
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€Web Content -contentproc -childID 5 -isForBrowser -prefsLen 5689 -prefMapSize 250958 -jsInitLen 279148 ...
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └─14*[{Web Content}]
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€WebExtensions -contentproc -childID 3 -isForBrowser -prefsLen 4990 -prefMapSize 250958 -jsInitLen 279148 ...
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └─21*[{WebExtensions}]
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚   └─93*[{GeckoMain}]
  β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   └─9*[{cinnamon}]
  β”‚   β”‚       β”‚   β”‚   β”‚   └─5*[{cinnamon-launch}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€clipit
  β”‚   β”‚       β”‚   β”‚   β”‚   └─2*[{clipit}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-a11y-keyboa
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-a11y-keyboa}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-a11y-settin
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-a11y-settin}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-automount
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-automount}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-background
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-background}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-clipboard
  β”‚   β”‚       β”‚   β”‚   β”‚   └─2*[{csd-clipboard}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-color
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-color}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-cursor
  β”‚   β”‚       β”‚   β”‚   β”‚   └─2*[{csd-cursor}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-housekeepin
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-housekeepin}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-keyboard
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-keyboard}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-media-keys
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-media-keys}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-mouse
  β”‚   β”‚       β”‚   β”‚   β”‚   β”œβ”€syndaemon -i 1.0 -t -K -R
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-mouse}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-orientation
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-orientation}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-power
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-power}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-print-notif
  β”‚   β”‚       β”‚   β”‚   β”‚   └─2*[{csd-print-notif}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-screensaver
  β”‚   β”‚       β”‚   β”‚   β”‚   └─2*[{csd-screensaver}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-sound
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-sound}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-xrandr
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-xrandr}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€csd-xsettings
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{csd-xsettings}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€(dbus-launch)
  β”‚   β”‚       β”‚   β”‚   β”œβ”€flameshot
  β”‚   β”‚       β”‚   β”‚   β”‚   └─7*[{flameshot}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€nemo-desktop
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{nemo-desktop}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€nm-applet
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{nm-applet}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€polkit-gnome-au
  β”‚   β”‚       β”‚   β”‚   β”‚   └─2*[{polkit-gnome-au}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€tracker-miner-f
  β”‚   β”‚       β”‚   β”‚   β”‚   └─4*[{tracker-miner-f}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€ulauncher /usr/bin/ulauncher --hide-window --hide-window
  β”‚   β”‚       β”‚   β”‚   β”‚   └─6*[{ulauncher}]
  β”‚   β”‚       β”‚   β”‚   β”œβ”€xapp-sn-watcher
  β”‚   β”‚       β”‚   β”‚   β”‚   └─3*[{xapp-sn-watcher}]
  β”‚   β”‚       β”‚   β”‚   └─3*[{cinnamon-sessio}]
  β”‚   β”‚       β”‚   └─2*[{lightdm}]
  β”‚   β”‚       └─2*[{lightdm}]
  β”‚   β”œβ”€runsv agetty-tty1
  β”‚   β”‚   └─agetty --noclear tty1 38400 linux
  β”‚   β”œβ”€runsv agetty-tty2
  β”‚   β”‚   └─agetty tty2 38400 linux
  β”‚   β”œβ”€runsv agetty-tty3
  β”‚   β”‚   └─agetty tty3 38400 linux
  β”‚   β”œβ”€runsv agetty-tty4
  β”‚   β”‚   └─agetty tty4 38400 linux
  β”‚   β”œβ”€runsv agetty-tty5
  β”‚   β”‚   └─agetty tty5 38400 linux
  β”‚   β”œβ”€runsv agetty-tty6
  β”‚   β”‚   └─agetty tty6 38400 linux
  β”‚   β”œβ”€runsv udevd
  β”‚   β”‚   └─udevd
  β”‚   β”œβ”€runsv auto-cpufreq
  β”‚   β”‚   └─auto-cpufreq /usr/bin/auto-cpufreq --daemon
  β”‚   β”œβ”€runsv chronyd
  β”‚   β”‚   └─chronyd -n -u chrony
  β”‚   └─runsv grub-btrfs
  β”‚       β”œβ”€vlogger -t grub-btrfs
  β”‚       └─wendy -m 960 -w /.snapshots sh -c if [ -s "/boot/grub/grub-btrfs.cfg" ]; then /etc/grub.d/41_snapshots-btrfs; else update-grub; fi
  β”œβ”€terminator /usr/bin/terminator
  β”‚   β”œβ”€zsh
  β”‚   β”‚   └─pstree -a
  β”‚   └─3*[{terminator}]
  β”œβ”€udisksd
  β”‚   └─5*[{udisksd}]
  β”œβ”€upowerd
  β”‚   └─2*[{upowerd}]
  β”œβ”€usbmuxd --user usbmux --udev
  β”‚   └─{usbmuxd}
  β”œβ”€wpa_supplicant -uq
  β”œβ”€xfconfd
  β”‚   └─2*[{xfconfd}]
  β”œβ”€zsh
  β”‚   └─gitstatusd-linu -G v1.5.1 -s -1 -u -1 -d -1 -c -1 -m -1 -v FATAL -t 8
  β”‚       └─8*[{gitstatusd-linu}]
  β”œβ”€zsh
  └─zsh
ghost commented 2 years ago

udev shouldn't be starting it until a device is attached

Agree on that one, but that is strange for us too.

In https://github.com/void-linux/void-packages/issues/34458#issuecomment-991890700 Austin booted into the rescue mode to exclude possible bloatware and got this too.

There is nothing but bash and udev.

austinrojers commented 2 years ago

So this issue is specific only to my Void installation? And both of your installations don't have this issue? Edit: Is there any possibility that I messed up my Void installation without intent?

Good Night. It's getting late here in India.

ghost commented 2 years ago

I tried to reproduce the issue with usbmuxd installed by rebooting again and again.

The process does not get started by udev on my side.

Is there any possibility that I messed up my Void installation without intent?

Might be possible.

austinrojers commented 2 years ago

Shall I reinstall Void Linux?

ghost commented 2 years ago

Backup your partitions and try.

In order not to waste your time, I would recommend to update packages, install usbmuxd and check it after installation without bothering to install X11, cinnamon and so on.

austinrojers commented 2 years ago

I have installed Void on BTRFS and configured it for snapper snapshots with @, @home... subvolumes, Is there a way I can install Void into @ subvolume without wiping the entire partition? That way I can preserve my @home partition

ghost commented 2 years ago

btrfs? My apologies, I do not use it myself, so I have nothing to suggest.

austinrojers commented 2 years ago

No problem. Shall I do it this Sunday or next week, a bit caught up for the coming days. I will update you as soon as possible. Thank you LOL, I have still not slept!

austinrojers commented 2 years ago

@dotnetfox I did a fresh reinstallation of Void Linux, installed usbmuxd, rebooted. Still same issues πŸ€” Please have a look here; this is what it looks like on boot: image

ahesford commented 2 years ago

The image has nothing to do with your issue, unless your phone is plugged in at boot. (In that case, of course udev would start usbmuxd; that would be expected behavior.)

Maybe you should echo /bin/bash >> /etc/rc.local (what's in that file now?) and reboot. This should drop you to an interactive shell right before all services are run. You can determine whether usbmuxd is running at that point.

austinrojers commented 2 years ago

The image has nothing to do with your issue, unless your phone is plugged in at boot. (In that case, of course, udev would start usbmuxd; that would be expected behavior.)

@ahesford, you're right, usbmuxd won't start on boot automatically; it would start only when the phone is plugged in. My phone was always plugged in to my laptop, and this was causing the confusion πŸ˜….

So now the story is; when I plug in my iPhone, usbmuxd starts automatically, and my phone starts charging(I forgot to mention before), but USB tethering and file transfer won't work. So naturally, I would try replugging my iPhone, and this time nothing would work, not even charging, and usbmuxd would still be running even after unplugging. Then if I kill usbmuxd, everything starts working instantly. Now, if I unplug my iPhone, usbmuxd would kill itself, and it starts automatically when I plug it in again.

It's just the first time usbmuxd won't work; you just have to kill it the first time, and everything starts working fine.

Thank you.

austinrojers commented 2 years ago

@dotnetfox please do have a look at the new findings

ghost commented 2 years ago

It's just the first time usbmuxd won't work; you just have to kill it the first time, and everything starts working fine.

This happens only when the device is plugged in before stage 2 of runit, I take it?

You see, runit runs udev on stage 1 in order to initialize all devices, yet it catches usbmuxd.

I believe running usbmuxd on stage 1 is a bad timing, given that this stage is designated for initialization, not hotplugging.

Eventually udev is butchered by runit and this time is run as service; but what becomes of usbmuxd which is running since stage 1? Nothing. Since udev was butchered, nothing is killing it.

This comes to be a reason as to why you have to kill it manually (udev is not my area of expertise, feel free to correct me if I am wrong).

My suggestion may sound foolish, but here is the workaround for you: try not to connect your device before stage 2 of runit (in your case until you reach the login screen).

As for the real solution with udev, I have nothing to suggest. Checking existence of a daemon and spamming it with usbmuxd -x? No idea.

Alpine, for example, chooses to live without udev: https://git.alpinelinux.org/aports/tree/testing/usbmuxd/001-confiure-no-udev.patch. Maybe they live with the same problem (or do not support udev, who knows?).

austinrojers commented 2 years ago

This happens only when the device is plugged in before stage 2 of runit, I take it?

No no. This happens whenever I plug in my device, not only specifically before stage 2 of runit.

So I think we can rule out the fact that this issue is caused by runit starting udev rules in stage 1 ( I don't know anything about udevs and init systems, its just an assumption I am making )

Whenever I plug in my iphone, even after login into graphical environment, its the same case.

It's just the first time usbmuxd won't work; you just have to kill it the first time, and everything starts working fine.

I hope have made it clear. If someone has an iphone, he could check this out if this this the case for everyone? We had already ruled out the usbmuxd runit service (which is not at all required for USB connection, it's the same case with or without it enabled) in above replies

Thank you @dotnetfox for still sticking with this issue, I really appreciate it!

ghost commented 2 years ago

No no. This happens whenever I plug in my device, not only specifically before stage 2 of runit.

Whenever I plug in my iphone, even after login into graphical environment, its the same case.

It's just the first time usbmuxd won't work; you just have to kill it the first time, and everything starts working fine.

I hope have made it clear.

Oh, cool.

Now we have an undefined behaviour.

I had borrowed apple's device for testing with runit and it worked perfectly; now that we have udev here to deal with, I have no such possibility anymore.

So I think we can rule out the fact that this issue is caused by runit starting udev rules in stage 1 (I don't know anything about udevs and init systems just an assumption)

If usbmuxd gets stuck even on stage 2 according to you, then this possibility can be crossed out for now.

Too bad, but I do not own nor have the possibility to borrow an iphone from someone to properly use it with usbmux anymore, meaning that I am of no use here, sadly.

austinrojers commented 2 years ago

@ahesford please do have a look at the updates after your last reply. And thank you for supporting this issue.

github-actions[bot] commented 2 years ago

Issues become stale 90 days after last activity and are closed 14 days after that. If this issue is still relevant bump it or assign it.