[systemd-devel] Any generic udev method for handling missing external programs?

Anne Mulhern amulhern at redhat.com
Mon Apr 4 17:16:23 UTC 2016


Hi!

I wondered if there already exists or were plans for some generic way to have an error on missing
external programs that are invoked by udev rules.

My particular problem was that somehow kpartx had gone missing on my system.
62-multipath-rules had a rule for invoking kpartx in order to make some linear devices
to map to partition devices. It invoked these, and the call failed. This failure was
logged in the journal, at level 3, which seems reasonable. However, there was
no connection of the journal log entry with the multipath rule, or anything like that.
The error was reported by the spawn_exec method, thus:

"""

Tue 2016-03-29 13:44:59.614256 EDT [s=07d0dd3e450e447b8176fae6f6ca2172;i=2759c4;b=4a123904d9fd4e2
7883b8169b32e4f8b;m=1b70a1aa78c;t=52f3396931d23;x=9bc01c815423a6b0]
    SYSLOG_FACILITY=3
    _TRANSPORT=journal
    _UID=0
    _GID=0
    _CAP_EFFECTIVE=1fffffffff
    _BOOT_ID=4a123904d9fd4e27883b8169b32e4f8b
    _MACHINE_ID=c2a1a2c9555048fab5453a08361c43dc
    _HOSTNAME=megadeth.lab.bos.redhat.com
    PRIORITY=3
    SYSLOG_IDENTIFIER=systemd-udevd
    _COMM=systemd-udevd
    CODE_FILE=src/udev/udev-event.c
    CODE_LINE=412
    CODE_FUNCTION=spawn_exec
    ERRNO=2
    MESSAGE=failed to execute '/sbin/kpartx' '/sbin/kpartx -a /dev/dm-25': No such file or directory
    _PID=40023
    _SOURCE_REALTIME_TIMESTAMP=1459273499614256
"""

The problem ramified, since the missing multipath partitions were part of another device, and so forth.

It seems like it would be nice for the udev rules to be able to specify their external dependencies,
and if their external dependencies were lacking, to stow a more useful message in the journal at some point.

If this can't be checked until about to execute, then it would be nice if there was a somewhat
more helpful message then the current one, which just says that the file is not found.
If it can be checked when the rules are being processed, then udev could log the problem at that time.

An argument could be made that no external programs that aren't certain to be installed should be
called in the udev rules. kpartx is required by multipath, so in theory this rule would have ensured
correctness. But, accidents do happen, like in this case where kpartx package was installed but
kpartx executable had left the building. (Actually, kpartx package appears to be required by systemd
so it would be reasonable to expect the executable to be around.)

So, is it impossible, likely to happen soon, already done, not worth the trouble?

TIA,

- mulhern


More information about the systemd-devel mailing list