Bug#639359: lintian should check if udev rules attempt to access programs in /usr
Package: lintian
Version: 2.5.2
Severity: wishlist
Rules installed into /lib/udev/rules.d may be called at boot before /usr
is mounted. Any rules files installed into this directory that attempt
to access binaries in /usr will fail with an error message printed at
boot, and whatever the rule was trying to set up may not be set up
properly.
Detection may be as simple as looking for '="/usr/' in these rules
files.
The fix, BTW, is also relatively simple. Packages that need to execute a
binary in /usr from a udev rule can install a wrapper script into
/lib/udev that waits for /usr to be mounted before executing the
program. Such a script may be as simple as:
#!/bin/sh -e
# /usr is not guaranteed to be mounted when udev starts
(
. /lib/udev/hotplug.functions
wait_for_file /usr/sbin/program
exec /usr/sbin/program "$@"
) &
Or, of course, they could move binaries to /sbin, or install a binary
for udev handling into /lib/udev, or install a more complicated script.
See bugs #624678, #635622, #636437, and #639356 for examples of bugs
this would detect.
Reply to: