I have a RedHat 7 VM running on VMware ESXi 6 infrastructure. I need to detect a floppy disk insert event and then kickoff a script based on that insert event.
My initial approach was to try and use Udev rules to trigger the script execution on floppy insert, but the event never seems to be kicked off.
SUBSYSTEM=="block", KERNEL=="fd0", ACTION=="change", RUN+="sh -c /my-custom-script"
When that wouldn't work, I tried to work around the issue and instead of executing on insert, I wrote a cron job that attempts to mount the floppy every couple minutes and tests to see if the mount point has certain files in it. This however, causes some nasty output when there's no floppy disk inserted though:
end_request: I/O error, dev fd0, sector0
So I've found myself trying to figure out why the Udev rule is not working. Is my approach with the Udev rule wrong or is there any other way to achieve this?