T
T
Tech2020-02-20 16:09:54
linux
Tech, 2020-02-20 16:09:54

The symlink on the device is not deleted when it is turned off?

cat /etc/udev/rules.d/51-android.rules

#Connect
SUBSYSTEM=="usb", ACTION=="bind", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="2717", ATTR{idProduct}=="ff48", SYMLINK+="Redmi66", TAG+="systemd", ENV{SYSTEMD_WANTS}="adb-starter.service"

I connect the device via usb. Symlink to the device is created. All right.
I pull out the cord.
systemctl list-units -a | grep "Redmi66"
dev-Redmi66.device loaded active plugged
That is, continues to be active.
Because of this, the service, in which After=dev-Redmi66.device is written, does not stop.
In the disconnect line, I would not like to fence the garden in the form of the second line ACTION="remove" and RUN+="stop service and so on".

In general, how to make udevd respond to the physical shutdown of the device?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Priluzkiy, 2020-02-20
@Oxyd

Did you create the symlink with a udev rule? udev rule and delete. Linux to you, what you didn’t tell him, he won’t do, and that’s good!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question