I want my Ubuntu 15.04 x64 server system to execute a script whenever a certain flash drive is inserted. So I created a custom rule file with the following content
The script executed whenever the flash drive is inserted, but I have two problems with it:
1) The script is apparently not executed when the computer is (re-)started with the drive already inserted. Is there any way to execute the script after startup if the flash drive is already connected?
2) The script wants to mount the device, but If I try to mount the device like
mount LABEL=mylabel /some/path
mount UUID=my-uuid /some/path
The source cannot be found. Currently I inserted a
into my script, but this does not seem like a reliable solution. Is there any (failure tolerant) way to wait for the system to be sufficiently initialized?
For testing purposes, the script only contained
#!/bin/sh date >> /tmp/test.log