Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
usbmount is finding devices and mounting them just fine, but it is not running any hook scripts I have put in /etc/usbmount/mount.d/ The scripts there have execute permissions and can run standalone manually. Here is a log snippet:
Code:
Feb 20 18:25:06 d usbmount[1255]: mountpoint /media/usb0 is available for /dev/sda4
Feb 20 18:25:06 d usbmount[1255]: executing command: mount -text4 -osync,noexec,nodev,noatime,nodiratime,ro /dev/sda4 /media/usb0
Feb 20 18:25:06 d kernel: [ 602.601902] EXT4-fs (sda4): mounted filesystem with ordered data mode. Opts: (null)
Feb 20 18:25:06 d usbmount[1255]: executing command: run-parts /etc/usbmount/mount.d
Feb 20 18:25:06 d usbmount[1255]: usbmount execution finished
Despite what is reported in the logs nothing seems to happen. The script is not run.
What should I be looking at to get the script there (or anywhere elese) to execute?
This is on Raspbian GNU/Linux 9.8 (stretch) and I've already done the /etc/systemd/system/systemd-udevd.service.d/override.conf hack to get systemd to stop blocking the mounts. Is there something else to change or remove to get usbmount to run a script?
Edit: daemon logs:
Code:
Feb 20 18:25:05 d systemd-udevd[1232]: Process '/usr/share/usbmount/usbmount add' failed with exit code 1.
Last edited by Turbocapitalist; 02-20-2019 at 11:53 AM.
Yes, and if I manually run run-parts using the line as given in the log then the script(s) run fine there. The scripts themselves seem to be OK. The weird part is that they ran once automatically today just fine.
Still sounds very strange.
How do you check that your scripts ran?
You could also inspect the usbmount source code to get a better understanding of the flow.
Distribution: in the past Mandrake, Debian, Knoppix, Antix, now Devuan
Posts: 21
Rep:
Are you sure that it is a usbmount-related problem? Cannot it be caused by weird systemd behavior?
Honestly, I do not know whether it is possible to get rid of systemd on Raspbian, but maybe it is worth testing on another system, e.g. on Devuan...
I'm also guessing that it is a systemd problem blocking the script somehow. It's not possible to remove systemd, it is neither an init system nor modular, so a distro either goes all-in or avoids it completely. The mounting works fine, it's just that the script won't run (though it did run once) and I've found a systemd work-around.
There seems to be a Devuan GNU/Linux 2.0 (ascii) image for the Raspberry Pi Zero. I will give that a test parallel to this, but I would really like to find a solution or non-systemd work-around for Raspbian.
I'm also guessing that it is a systemd problem blocking the script somehow. It's not possible to remove systemd, it is neither an init system nor modular, so a distro either goes all-in or avoids it completely. The mounting works fine, it's just that the script won't run (though it did run once) and I've found a systemd work-around.
There seems to be a Devuan GNU/Linux 2.0 (ascii) image for the Raspberry Pi Zero. I will give that a test parallel to this, but I would really like to find a solution or non-systemd work-around for Raspbian.
Hi Turbocapitalist, i have exactly the same problem. Can you tell me your workaround?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.