I'm writing a local program to be called by a udev IMPORT{program}
rule. Normally, I'd install local software in /usr/local
, but these udev rules are run when block devices appear. So they're running long before /usr
is necessarily mounted.
I believe I'll also have to configure this to be copied to initramfs (which is easily done with /etc/initramfs-tools/hooks/
). Normally, it seems, things use the same path on initramfs as on the root filesystem. (edit: it appears I don't actually have to add it to initramfs, the events are re-triggered after rootfs is mounted)
/etc
is version controlled, so binaries there are best avoided.
I'm thinking my best bet may just be to install this in /lib/udev
, under a file name starting with local-
to avoid clashing with any future files from the distro. The also makes the udev rules file prettier (since it won't need to specify full path).
This machine is running Debian Squeeze. Is there some standard location for this file? I don't believe FHS or Debian Policy specifies one.