Deferring jobs for later
James Hunt
james.hunt at ubuntu.com
Fri Mar 9 15:14:10 UTC 2012
On 09/03/12 12:32, Svein Seldal wrote:
>
> I have a script which should be executed when a certain USB device is
> inserted into the machine. This script is handled by a udev rule.
> However, this script is often run too early (no writable fs yet) if the
> USB device is left inserted when booting the system. Is there a way I
> can defer this script with the aid of upstart until the system is system
> is up?
>
> What about:
>
> udev rule: initctl emit device_inserted
>
> upstart task:
> start on device_inserted and stopped rc
>
> ^^ Would this work? I mean since the device_inserted emit will come much
> before rc has stopped? I'm uncertain how the combining of events such as
> these actually behave.
>
> Regards,
> Svein Seldal
>
>
Hi Svein,
start on (usb-device-added FOO=bar hello=world and filesystem)
Here, the usb-device-added events occurs early in the boot sequence, but Upstart will not run this
job until the _entire_ condition is satisfied, that is to say when all filesystems are mounted.
See:
- upstart-udev-bridge(8)
- upstart-events(7)
- /var/log/udev
- http://upstart.ubuntu.com/cookbook/#upstart-udev-bridge
Kind regards,
James
--
James Hunt
____________________________________
http://upstart.ubuntu.com/cookbook
http://upstart.ubuntu.com/cookbook/upstart_cookbook.pdf
More information about the upstart-devel
mailing list