Welcome! Log In Create A New Profile

Advanced

udev@bootime: the only command can be triggered is mount?

Posted by SiliCAT 
udev@bootime: the only command can be triggered is mount?
October 18, 2016 10:31PM
Box: Pogoplug V4

I installed Debian on the SD card.
I have an external usb hard disk, I want to achieve this: every time when the disk is connected, the system will provide file service and start some programs.
So I use udev rules and scripts.
The scripts works well when I plug in the disk driver or unplug it from the usb port. But when the system reboot, the scripts do not work during the boot time.
I took several hours to test the rules and scripts, and found it seems the only command that can be executed in the udev rules at the boot time is "/bin/mount".

Is there any way to debug the udev process at the boot time?



Edited 4 time(s). Last edit at 10/18/2016 10:46PM by SiliCAT.
Re: udev@bootime: the only command can be triggered is mount?
October 19, 2016 04:06AM
SiliCAT,

> So I use udev rules and scripts.
> The scripts works well when I plug in the disk
> driver or unplug it from the usb port. But when
> the system reboot, the scripts do not work during
> the boot time.
> I took several hours to test the rules and
> scripts, and found it seems the only command that
> can be executed in the udev rules at the boot time
> is "/bin/mount".
>

Don't try to debug udev during boot. It is simple if you do both of these.

1. Have udev rules that executed an automount and a script in /etc/udev/rules.d/70-automount.rules. The script is executed when you plug it in later after the system is running (as you've already verified).

2. Place this script execution in /etc/rc.local (and in the script check the mount status first, if it is not mount then mount it). This ensure if the USB disk is presented, it will do what it's supposed to do.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: udev@bootime: the only command can be triggered is mount?
October 19, 2016 04:20PM
Hi bodhi,
Thank you for your reply.
This is a more feasible and practicable plan.
Maybe It's time for me to give up on finding a perfect approach.
Re: udev@bootime: the only command can be triggered is mount?
October 19, 2016 07:10PM
SiliCAT,

> Maybe It's time for me to give up on finding a
> perfect approach.

I know, been there :) being somewhat a perfectionist myself, sometime it took me hours to debug a problem while I know it would take me a few minutes to implement a sensible solution for it.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: udev@bootime: the only command can be triggered is mount?
October 20, 2016 02:55PM
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: