Re: [systemd-devel] need to run systemctl --user daemon-reload to get USB device properly recognized
Maybe you have some generators interfering? https://unix.stackexchange.com/a/364787/117660 On July 20, 2018 8:23:30 PM Matt Zagrabelny wrote: Ping? Any ideas systemd masters? Thanks! -m On Fri, Jul 6, 2018 at 3:54 PM, Matt Zagrabelny wrote: Greetings, I'm seeing some unexpected behavior for my systemd --user process. Background: 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: ==> /etc/udev/rules.d/90-canon-60d.rules <== # Download photos from Canon 60D ACTION=="add" \ ENV{GPHOTO2_DRIVER}=="PTP" \ ENV{ID_VENDOR_ID}=="04a9" \ ENV{ID_MODEL_ID}=="3215" \ TAG+="systemd" \ PROGRAM="/bin/systemd-escape --template=download-photos@.service Canon_60D_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}" \ ENV{SYSTEMD_USER_WANTS}+="%c" ==> /etc/udev/rules.d/90-galaxy-note-3.rules <== # Download photos from Galaxy Note 3 ACTION=="add" \ ENV{ID_MTP_DEVICE}=="1" \ ENV{ID_VENDOR_ID}=="04e8" \ ENV{ID_MODEL_ID}=="6860" \ ENV{ID_SERIAL_SHORT}=="17b765cc" \ TAG+="systemd" \ PROGRAM="/bin/systemd-escape --template=download-photos@.service $env{ID_SERIAL}" \ ENV{SYSTEMD_USER_WANTS}+="%c" ==> ~/.config/systemd/user/download-photos@.service <== [Service] Type=oneshot ExecStart=/usr/bin/mate-terminal --maximize --command '/usr/bin/imagdo --config-file %h/.imagdo/conf/%I.yaml' SuccessExitStatus=0 255 However, after plugging in my phone, I need to run: systemctl --user daemon-reload in order to get udev/systemd to recognize my camera being plugged in and fire off the "download" script. Here are the logs from the journal of the download working for my phone: Jul 06 13:54:08 eruke kernel: usb 3-2: USB disconnect, device number 5 Jul 06 13:54:08 eruke kernel: pktcdvd: pktcdvd0: writer unmapped Jul 06 13:54:08 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 Jul 06 13:54:08 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci:00/:00:14.0/usb3/3-2 Jul 06 13:54:08 eruke kernel: usb 3-2: new high-speed USB device number 6 using xhci_hcd Jul 06 13:54:08 eruke kernel: usb 3-2: New USB device found, idVendor=04e8, idProduct=6860 Jul 06 13:54:08 eruke kernel: usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Jul 06 13:54:08 eruke kernel: usb 3-2: Product: SAMSUNG_Android Jul 06 13:54:08 eruke kernel: usb 3-2: Manufacturer: SAMSUNG Jul 06 13:54:08 eruke kernel: usb 3-2: SerialNumber: 17b765cc Jul 06 13:54:08 eruke systemd[1340]: Created slice download\x2dphotos.slice. Jul 06 13:54:08 eruke systemd[1340]: Starting download-photos@SAMSUNG_ SAMSUNG_Android_17b765cc.service... Jul 06 13:54:08 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci:00/:00:14.0/usb3/3-2 Jul 06 13:54:09 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 Jul 06 13:54:10 eruke kernel: fuse init (API version 7.26) Jul 06 13:54:10 eruke systemd[1]: Mounting FUSE Control File System... Jul 06 13:54:10 eruke systemd[1]: Mounted FUSE Control File System. Jul 06 13:54:11 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 Jul 06 13:54:13 eruke pkexec[19143]: pam_unix(polkit-1:session): session opened for user root by (uid=1000) 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] Jul 06 13:54:13 eruke systemd[1340]: Started download-photos@SAMSUNG_ SAMSUNG_Android_17b765cc.service. Jul 06 13:54:18 eruke kernel: usb 3-2: USB disconnect, device number 6 Jul 06 13:54:18 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci:00/:00:14.0/usb3/3-2 Jul 06 13:54:23 eruke pkexec[19157]: pam_unix(polkit-1:session): session opened for user root by (uid=1000) Here are the journal logs of the download __not__ working for my camera: Jul 06 13:55:02 eruke kernel: usb 3-2: new high-speed USB device number 7 using xhci_hcd Jul 06 13:55:02 eruke kernel: usb 3-2: New USB device found, idVendor=04a9, idProduct=3215 Jul 06 13:55:02 eruke kernel: usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 Jul 06 13:55:02 eruke kernel: usb 3-2: Product: Canon Digital Camera Jul 06 13:55:02 eruke kernel: usb 3-2: Manufacturer: Canon Inc. Jul 06 13:55:02 eruke mtp-probe[19173]: checking bus 3, device 7: "/sys/devices/pci:00/:00:14.0/usb3/3-2" Jul 06 13:55:02 eruke mtp-probe[19173]: bus: 3, device: 7 was not an MTP device Jul 06 13:55:02 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci:00/:00:14.0/usb3/3-2 Jul 06 13:55:03 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 Jul 06 13:55:03 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 Here is the daemon-reload: Jul 06 13:
Re: [systemd-devel] need to run systemctl --user daemon-reload to get USB device properly recognized
Ping? Any ideas systemd masters? Thanks! -m On Fri, Jul 6, 2018 at 3:54 PM, Matt Zagrabelny wrote: > Greetings, > > I'm seeing some unexpected behavior for my systemd --user process. > Background: > > 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: > > ==> /etc/udev/rules.d/90-canon-60d.rules <== > # Download photos from Canon 60D > ACTION=="add" \ > ENV{GPHOTO2_DRIVER}=="PTP" \ > ENV{ID_VENDOR_ID}=="04a9" \ > ENV{ID_MODEL_ID}=="3215" \ > TAG+="systemd" \ > PROGRAM="/bin/systemd-escape --template=download-photos@.service > Canon_60D_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}" \ > ENV{SYSTEMD_USER_WANTS}+="%c" > > ==> /etc/udev/rules.d/90-galaxy-note-3.rules <== > # Download photos from Galaxy Note 3 > ACTION=="add" \ > ENV{ID_MTP_DEVICE}=="1" \ > ENV{ID_VENDOR_ID}=="04e8" \ > ENV{ID_MODEL_ID}=="6860" \ > ENV{ID_SERIAL_SHORT}=="17b765cc" \ > TAG+="systemd" \ > PROGRAM="/bin/systemd-escape --template=download-photos@.service > $env{ID_SERIAL}" \ > ENV{SYSTEMD_USER_WANTS}+="%c" > > ==> ~/.config/systemd/user/download-photos@.service <== > [Service] > Type=oneshot > ExecStart=/usr/bin/mate-terminal --maximize --command '/usr/bin/imagdo > --config-file %h/.imagdo/conf/%I.yaml' > SuccessExitStatus=0 255 > > However, after plugging in my phone, I need to run: > > systemctl --user daemon-reload > > in order to get udev/systemd to recognize my camera being plugged in and > fire off the "download" script. > > Here are the logs from the journal of the download working for my phone: > > Jul 06 13:54:08 eruke kernel: usb 3-2: USB disconnect, device number 5 > Jul 06 13:54:08 eruke kernel: pktcdvd: pktcdvd0: writer unmapped > Jul 06 13:54:08 eruke upowerd[1619]: unhandled action 'unbind' on > /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 > Jul 06 13:54:08 eruke upowerd[1619]: unhandled action 'unbind' on > /sys/devices/pci:00/:00:14.0/usb3/3-2 > Jul 06 13:54:08 eruke kernel: usb 3-2: new high-speed USB device number 6 > using xhci_hcd > Jul 06 13:54:08 eruke kernel: usb 3-2: New USB device found, > idVendor=04e8, idProduct=6860 > Jul 06 13:54:08 eruke kernel: usb 3-2: New USB device strings: Mfr=1, > Product=2, SerialNumber=3 > Jul 06 13:54:08 eruke kernel: usb 3-2: Product: SAMSUNG_Android > Jul 06 13:54:08 eruke kernel: usb 3-2: Manufacturer: SAMSUNG > Jul 06 13:54:08 eruke kernel: usb 3-2: SerialNumber: 17b765cc > Jul 06 13:54:08 eruke systemd[1340]: Created slice > download\x2dphotos.slice. > Jul 06 13:54:08 eruke systemd[1340]: Starting download-photos@SAMSUNG_ > SAMSUNG_Android_17b765cc.service... > Jul 06 13:54:08 eruke upowerd[1619]: unhandled action 'bind' on > /sys/devices/pci:00/:00:14.0/usb3/3-2 > Jul 06 13:54:09 eruke upowerd[1619]: unhandled action 'bind' on > /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 > Jul 06 13:54:10 eruke kernel: fuse init (API version 7.26) > Jul 06 13:54:10 eruke systemd[1]: Mounting FUSE Control File System... > Jul 06 13:54:10 eruke systemd[1]: Mounted FUSE Control File System. > Jul 06 13:54:11 eruke upowerd[1619]: unhandled action 'unbind' on > /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 > Jul 06 13:54:13 eruke pkexec[19143]: pam_unix(polkit-1:session): session > opened for user root by (uid=1000) > 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] > Jul 06 13:54:13 eruke systemd[1340]: Started download-photos@SAMSUNG_ > SAMSUNG_Android_17b765cc.service. > Jul 06 13:54:18 eruke kernel: usb 3-2: USB disconnect, device number 6 > Jul 06 13:54:18 eruke upowerd[1619]: unhandled action 'unbind' on > /sys/devices/pci:00/:00:14.0/usb3/3-2 > Jul 06 13:54:23 eruke pkexec[19157]: pam_unix(polkit-1:session): session > opened for user root by (uid=1000) > > Here are the journal logs of the download __not__ working for my camera: > > Jul 06 13:55:02 eruke kernel: usb 3-2: new high-speed USB device number 7 > using xhci_hcd > Jul 06 13:55:02 eruke kernel: usb 3-2: New USB device found, > idVendor=04a9, idProduct=3215 > Jul 06 13:55:02 eruke kernel: usb 3-2: New USB device strings: Mfr=1, > Product=2, SerialNumber=0 > Jul 06 13:55:02 eruke kernel: usb 3-2: Product: Canon Digital Camera > Jul 06 13:55:02 eruke kernel: usb 3-2: Manufacturer: Canon Inc. > Jul 06 13:55:02 eruke mtp-probe[19173]: checking bus 3, device 7: > "/sys/devices/pci:00/:00:14.0/usb3/3-2" > Jul 06 13:55:02 eruke mtp-probe[19173]: bus: 3, device: 7 was not an MTP > device > Jul 06 13:55:02 eruke upowerd[1619]: unhandled action 'bind' on > /sys/devices/pci:00/:00:14.0/usb3/3-2 > Jul 06 13:55:03 eruke upowerd[1619]: unhandled action 'bind' on > /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 > Jul 06 13:55:03 eruke upowerd[1619]: unhandled action 'unbind' on > /sys/devices/pci:00/:00:14.0/
Re: [systemd-devel] need to run systemctl --user daemon-reload to get USB device properly recognized
On Fr, 06.07.18 15:54, Matt Zagrabelny (mzagr...@d.umn.edu) wrote: > Greetings, > > I'm seeing some unexpected behavior for my systemd --user process. > Background: > > 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: Is this possibly the same issue as the following? https://github.com/systemd/systemd/issues/9518 Lennart -- Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] need to run systemctl --user daemon-reload to get USB device properly recognized
Greetings, I'm seeing some unexpected behavior for my systemd --user process. Background: 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: ==> /etc/udev/rules.d/90-canon-60d.rules <== # Download photos from Canon 60D ACTION=="add" \ ENV{GPHOTO2_DRIVER}=="PTP" \ ENV{ID_VENDOR_ID}=="04a9" \ ENV{ID_MODEL_ID}=="3215" \ TAG+="systemd" \ PROGRAM="/bin/systemd-escape --template=download-photos@.service Canon_60D_$env{ID_VENDOR_ID}_$env{ID_MODEL_ID}" \ ENV{SYSTEMD_USER_WANTS}+="%c" ==> /etc/udev/rules.d/90-galaxy-note-3.rules <== # Download photos from Galaxy Note 3 ACTION=="add" \ ENV{ID_MTP_DEVICE}=="1" \ ENV{ID_VENDOR_ID}=="04e8" \ ENV{ID_MODEL_ID}=="6860" \ ENV{ID_SERIAL_SHORT}=="17b765cc" \ TAG+="systemd" \ PROGRAM="/bin/systemd-escape --template=download-photos@.service $env{ID_SERIAL}" \ ENV{SYSTEMD_USER_WANTS}+="%c" ==> ~/.config/systemd/user/download-photos@.service <== [Service] Type=oneshot ExecStart=/usr/bin/mate-terminal --maximize --command '/usr/bin/imagdo --config-file %h/.imagdo/conf/%I.yaml' SuccessExitStatus=0 255 However, after plugging in my phone, I need to run: systemctl --user daemon-reload in order to get udev/systemd to recognize my camera being plugged in and fire off the "download" script. Here are the logs from the journal of the download working for my phone: Jul 06 13:54:08 eruke kernel: usb 3-2: USB disconnect, device number 5 Jul 06 13:54:08 eruke kernel: pktcdvd: pktcdvd0: writer unmapped Jul 06 13:54:08 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 Jul 06 13:54:08 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci:00/:00:14.0/usb3/3-2 Jul 06 13:54:08 eruke kernel: usb 3-2: new high-speed USB device number 6 using xhci_hcd Jul 06 13:54:08 eruke kernel: usb 3-2: New USB device found, idVendor=04e8, idProduct=6860 Jul 06 13:54:08 eruke kernel: usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Jul 06 13:54:08 eruke kernel: usb 3-2: Product: SAMSUNG_Android Jul 06 13:54:08 eruke kernel: usb 3-2: Manufacturer: SAMSUNG Jul 06 13:54:08 eruke kernel: usb 3-2: SerialNumber: 17b765cc Jul 06 13:54:08 eruke systemd[1340]: Created slice download\x2dphotos.slice. Jul 06 13:54:08 eruke systemd[1340]: Starting download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service... Jul 06 13:54:08 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci:00/:00:14.0/usb3/3-2 Jul 06 13:54:09 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 Jul 06 13:54:10 eruke kernel: fuse init (API version 7.26) Jul 06 13:54:10 eruke systemd[1]: Mounting FUSE Control File System... Jul 06 13:54:10 eruke systemd[1]: Mounted FUSE Control File System. Jul 06 13:54:11 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 Jul 06 13:54:13 eruke pkexec[19143]: pam_unix(polkit-1:session): session opened for user root by (uid=1000) 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] Jul 06 13:54:13 eruke systemd[1340]: Started download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service. Jul 06 13:54:18 eruke kernel: usb 3-2: USB disconnect, device number 6 Jul 06 13:54:18 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci:00/:00:14.0/usb3/3-2 Jul 06 13:54:23 eruke pkexec[19157]: pam_unix(polkit-1:session): session opened for user root by (uid=1000) Here are the journal logs of the download __not__ working for my camera: Jul 06 13:55:02 eruke kernel: usb 3-2: new high-speed USB device number 7 using xhci_hcd Jul 06 13:55:02 eruke kernel: usb 3-2: New USB device found, idVendor=04a9, idProduct=3215 Jul 06 13:55:02 eruke kernel: usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 Jul 06 13:55:02 eruke kernel: usb 3-2: Product: Canon Digital Camera Jul 06 13:55:02 eruke kernel: usb 3-2: Manufacturer: Canon Inc. Jul 06 13:55:02 eruke mtp-probe[19173]: checking bus 3, device 7: "/sys/devices/pci:00/:00:14.0/usb3/3-2" Jul 06 13:55:02 eruke mtp-probe[19173]: bus: 3, device: 7 was not an MTP device Jul 06 13:55:02 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci:00/:00:14.0/usb3/3-2 Jul 06 13:55:03 eruke upowerd[1619]: unhandled action 'bind' on /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 Jul 06 13:55:03 eruke upowerd[1619]: unhandled action 'unbind' on /sys/devices/pci:00/:00:14.0/usb3/3-2/3-2:1.0 Here is the daemon-reload: Jul 06 13:55:24 eruke systemd[1340]: Reloading. And here are the journal logs of the download working for the camera being plugged in: Jul 06 13:55:30 eruke kernel: usb 3-2: new high-speed USB device number 8 using xhci_hcd Jul 06 13:55:30 eruke kernel: usb 3-2: N