LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Naming scripts for use with run-parts under usbmount (https://www.linuxquestions.org/questions/linux-server-73/naming-scripts-for-use-with-run-parts-under-usbmount-4175644381/)

Turbocapitalist 12-16-2018 07:00 AM

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?

goumba 12-16-2018 10:24 AM

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

Turbocapitalist 12-16-2018 11:17 AM

That's what I thought too, but trying it has no apparent effect. run-parts seems to ignore the scripts I put there.

goumba 12-18-2018 02:36 PM

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

Turbocapitalist 12-20-2018 02:16 AM

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.

rknichols 12-20-2018 08:59 AM

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.