<div dir="ltr">Greetings,<div><br></div><div>I'm seeing some unexpected behavior for my systemd --user process. Background:</div><div><br></div><div>I've setup udev rules to fire off systemd --user units to download photos when my camera (PTP device) or my phone (MTP device) get plugged in. They are both USB devices:</div><div><br></div><div><div>==> /etc/udev/rules.d/90-canon-60d.rules <==</div><div># Download photos from Canon 60D</div><div>ACTION=="add" \</div><div>ENV{GPHOTO2_DRIVER}=="PTP" \</div><div>ENV{ID_VENDOR_ID}=="04a9" \</div><div>ENV{ID_MODEL_ID}=="3215" \</div><div>TAG+="systemd" \</div><div>PROGRAM="/bin/systemd-escape --template=download-photos@.service Canon_60D_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}" \</div><div>ENV{SYSTEMD_USER_WANTS}+="%c"</div><div><br></div><div>==> /etc/udev/rules.d/90-galaxy-note-3.rules <==</div><div># Download photos from Galaxy Note 3</div><div>ACTION=="add" \</div><div>ENV{ID_MTP_DEVICE}=="1" \</div><div>ENV{ID_VENDOR_ID}=="04e8" \</div><div>ENV{ID_MODEL_ID}=="6860" \</div><div>ENV{ID_SERIAL_SHORT}=="17b765cc" \</div><div>TAG+="systemd" \</div><div>PROGRAM="/bin/systemd-escape --template=download-photos@.service $env{ID_SERIAL}" \</div><div>ENV{SYSTEMD_USER_WANTS}+="%c"</div></div><div><br></div><div><div>==> ~/.config/systemd/user/download-photos@.service <==</div><div>[Service]</div><div>Type=oneshot</div><div>ExecStart=/usr/bin/mate-terminal --maximize --command '/usr/bin/imagdo --config-file %h/.imagdo/conf/%I.yaml'</div><div>SuccessExitStatus=0 255</div></div><div><br></div><div>However, after plugging in my phone, I need to run:</div><div><br></div><div>systemctl --user daemon-reload</div><div><br></div><div>in order to get udev/systemd to recognize my camera being plugged in and fire off the "download" script.<br></div><div><br></div><div>Here are the logs from the journal of the download working for my phone:</div><div><br></div><div><div>Jul 06 13:54:08 eruke kernel: usb 3-2: USB disconnect, device number 5</div><div>Jul 06 13:54:08 eruke kernel: pktcdvd: pktcdvd0: writer unmapped</div><div>Jul 06 13:54:08 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0</div><div>Jul 06 13:54:08 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2</div><div>Jul 06 13:54:08 eruke kernel: usb 3-2: new high-speed USB device number 6 using xhci_hcd</div><div>Jul 06 13:54:08 eruke kernel: usb 3-2: New USB device found, idVendor=04e8, idProduct=6860</div><div>Jul 06 13:54:08 eruke kernel: usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3</div><div>Jul 06 13:54:08 eruke kernel: usb 3-2: Product: SAMSUNG_Android</div><div>Jul 06 13:54:08 eruke kernel: usb 3-2: Manufacturer: SAMSUNG</div><div>Jul 06 13:54:08 eruke kernel: usb 3-2: SerialNumber: 17b765cc</div><div>Jul 06 13:54:08 eruke systemd[1340]: Created slice download\x2dphotos.slice.</div><div>Jul 06 13:54:08 eruke systemd[1340]: Starting download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service...</div><div>Jul 06 13:54:08 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2</div><div>Jul 06 13:54:09 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0</div><div>Jul 06 13:54:10 eruke kernel: fuse init (API version 7.26)</div><div>Jul 06 13:54:10 eruke systemd[1]: Mounting FUSE Control File System...</div><div>Jul 06 13:54:10 eruke systemd[1]: Mounted FUSE Control File System.</div><div>Jul 06 13:54:11 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0</div><div>Jul 06 13:54:13 eruke pkexec[19143]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)</div><div>Jul 06 13:54:13 eruke pkexec[19143]: mzagrabe: Executing command [USER=root] [TTY=unknown] [CWD=/home/mzagrabe] [COMMAND=/usr/sbin/mate-power-backlight-helper --set-brightness 3093]</div><div>Jul 06 13:54:13 eruke systemd[1340]: Started download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service.</div><div>Jul 06 13:54:18 eruke kernel: usb 3-2: USB disconnect, device number 6</div><div>Jul 06 13:54:18 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2</div><div>Jul 06 13:54:23 eruke pkexec[19157]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)</div></div><div><br></div><div>Here are the journal logs of the download __not__ working for my camera:</div><div><br></div><div><div>Jul 06 13:55:02 eruke kernel: usb 3-2: new high-speed USB device number 7 using xhci_hcd</div><div>Jul 06 13:55:02 eruke kernel: usb 3-2: New USB device found, idVendor=04a9, idProduct=3215</div><div>Jul 06 13:55:02 eruke kernel: usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0</div><div>Jul 06 13:55:02 eruke kernel: usb 3-2: Product: Canon Digital Camera</div><div>Jul 06 13:55:02 eruke kernel: usb 3-2: Manufacturer: Canon Inc.</div><div>Jul 06 13:55:02 eruke mtp-probe[19173]: checking bus 3, device 7: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2"</div><div>Jul 06 13:55:02 eruke mtp-probe[19173]: bus: 3, device: 7 was not an MTP device</div><div>Jul 06 13:55:02 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2</div><div>Jul 06 13:55:03 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0</div><div>Jul 06 13:55:03 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0</div></div><div><br></div><div>Here is the daemon-reload:</div><div><br></div><div><div>Jul 06 13:55:24 eruke systemd[1340]: Reloading.</div></div><div><br></div><div><br></div><div>And here are the journal logs of the download working for the camera being plugged in:</div><div><br></div><div><div>Jul 06 13:55:30 eruke kernel: usb 3-2: new high-speed USB device number 8 using xhci_hcd</div><div>Jul 06 13:55:30 eruke kernel: usb 3-2: New USB device found, idVendor=04a9, idProduct=3215</div><div>Jul 06 13:55:30 eruke kernel: usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0</div><div>Jul 06 13:55:30 eruke kernel: usb 3-2: Product: Canon Digital Camera</div><div>Jul 06 13:55:30 eruke kernel: usb 3-2: Manufacturer: Canon Inc.</div><div>Jul 06 13:55:30 eruke mtp-probe[19275]: checking bus 3, device 8: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2"</div><div>Jul 06 13:55:30 eruke mtp-probe[19275]: bus: 3, device: 8 was not an MTP device</div><div>Jul 06 13:55:30 eruke systemd[1340]: Starting download-photos@Canon_60D_04a9_3215.service...</div><div>Jul 06 13:55:30 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2</div><div>Jul 06 13:55:30 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0</div><div>Jul 06 13:55:30 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0</div><div>Jul 06 13:55:31 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0</div><div>Jul 06 13:55:34 eruke pkexec[19322]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)</div><div>Jul 06 13:55:34 eruke pkexec[19322]: mzagrabe: Executing command [USER=root] [TTY=unknown] [CWD=/home/mzagrabe] [COMMAND=/usr/sbin/mate-power-backlight-helper --set-brightness 945]</div><div>Jul 06 13:55:37 eruke dring[1794]: NAT-PMP: can't send request</div><div>Jul 06 13:56:18 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0</div><div>Jul 06 13:56:20 eruke pkexec[19432]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)</div><div>Jul 06 13:56:20 eruke pkexec[19432]: mzagrabe: Executing command [USER=root] [TTY=unknown] [CWD=/home/mzagrabe] [COMMAND=/usr/sbin/mate-power-backlight-helper --set-brightness 3093]</div><div>Jul 06 13:56:21 eruke systemd[1340]: Started download-photos@Canon_60D_04a9_3215.service.</div><div>Jul 06 13:56:23 eruke kernel: usb 3-2: USB disconnect, device number 8</div><div>Jul 06 13:56:23 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2</div></div><div><br></div><div>Any ideas what to look for or how to fix the need to run the daemon-reload between plugging in the two USB devices?</div><div><br></div><div>Thanks!</div><div><br></div><div>-m</div></div>