Can udev be used to trigger an action when an always-connected drive is mounted, or is it only useful for hotplugging (as the documentation suggests)?
I want to trigger a script when my always-connected SD card is mounted. This rule, placed inside /etc/udev/rules.d looks okay in syntax:
KERNEL=="mmcblk0",ACTION=="mount",RUN+="/path/to/script.sh"
But the script does not run when the drive is mounted.
Once again, there is no hotplugging and the drive is an SD card (hence the mmcblk0 device name).
If udev is not appropriate, what else might work?
executepermission? 2. do you see mount action for the drive? if not refer linux.die.net/man/8/udevadm and see what event is spit out by udev when drive is mounted. if it is at startup, does udev starts before drive mounted ?udevadm monitorto see events and then write ruleudevfires nomountevent, just a bunch ofadd,removeandchange. Will have to find a workaround.