J
J
Justanotherusa2018-04-25 13:24:48
linux
Justanotherusa, 2018-04-25 13:24:48

How to bind the launch of the application when connecting an external hard drive?

I want to bind the start of the Yandex.Disk daemon after connecting an external usb hard drive to start synchronization, and stop when disconnected.
It is clear that you need to use udev, but after looking at the possible implementations, I got confused in the old material. How exactly to do this in a modern (eg debian 9) distribution?
Everywhere they write that mounting via udev is highly discouraged. Yes, and I don’t want to fasten a thick script, it seems to me that there are easier solutions.
udisks-glue looks dead to poke even with a stick.
For systemd.mount/automount, the specifics are not entirely clear, is it suitable for removable media or only for network resources?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
chupasaurus, 2018-04-25
@chupasaurus

systemd.mount is perfect for you.

the specifics are not entirely clear, is it suitable for removable media or only for network resources?
/etc/fstab is translated into mount units that systemd already mounts, let alone network resources. In your case, mount / umount will not add any additional magic compared to manual mount / umount.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question