Naming scripts for use with run-parts under usbmount
What naming convention is used by run-parts under usbmount?
The package usbmount allegedly launches scripts from the /etc/usbmount/mount.d/ directory whenever a device is mounted. However, nothing in the usbmount README file gives a hint as to how these scripts should be named so that they are launched. How do I get usbmount to launch a custom script? |
Typically, if there is no convention given they can be whatever you want. I've always found a SysV style naming to be safe, something like: ##-my_device_name
|
That's what I thought too, but trying it has no apparent effect. run-parts seems to ignore the scripts I put there.
|
Dumb question, but sometimes I have to smack myself in the forehead for this very reason... ;) they are executable right?
Found this, maybe this will shed some light: https://github.com/rbrito/usbmount |
Thanks. My method is to make sure the script works manually first before automating it. So the executable bit is set.
I've seen the usbmount link there but will take a closer look at it again. |
Do your scripts start with a proper "#!..." line? Without that, the exec() system call to run them will fail. Running them manually can still work, but that's due to a shell fallback after the exec() call fails with ENOEXEC (Exec format error).
|
All times are GMT -5. The time now is 03:28 AM. |