On 04/27/2010 02:27 PM, Oren Held wrote: > Hello, > > RHEL5 still uses an old udev version (095 based) which supports the > deprecated "last_rule" directive. I've encountered an annoying case in > which a RedHat-supplied rules file simply prevents me from adding > additional rules (in different rules file, because I want to avoid > modifying RedHat's rules file). > > The file is 40-multipath.rules; they've got the following two rules > inside (among others): > PROGRAM=="/sbin/dmsetup info -c --noheadings -o name -j %M -m %m", > RESULT=="?*", NAME="%k", SYMLINK="mpath/%c", RUN+="/sbin/kpartx -a -p p > /dev/mapper/%c" > OPTIONS="last_rule" > > Now, adding more SYMLINKS in a separate rule seems like an impossible task: > * I cannot do it in a later rule: because of the "last_rule" directive > is used. > * I cannot do it in an earlier rule: because of the NAME="%k", afaik you > cannot name a device twice, and empirically adding NAME="%k" in an > earlier rule prevents from the next NAME="%k" rule to run. > Furthermore, their usage of SYMLINK= (assignment, instead of appending > with +=) means that all previously set SYMLINKs are getting overwritten. > > Did I get it right? I wonder if there is something creative to do here, > or is it a complete no-go.
I'm not sure about the device-mapper-multipath-specific nature of this problem, but when I had problems with Red Hat's provided files while developing a customized RHEL, I would use the %triggerin and %triggerun directives in my own customization RPM. I would trigger on the Red Hat RPM (in your case device-mapper-multipath) and use perl -pi or sed -e to update the Red Hat-provided file as needed. It was a mess and most people would just use Puppet or cfengine to overwrite the file, but I was using purely RPMs for customizations at the time. The syntax is specified here: http://www.rpm.org/api/4.4.2.2/triggers.html /Brian/ -- Brian Long | | Corporate Security Programs Org . | | | . | | | . ' ' C I S C O _______________________________________________ rhelv5-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/rhelv5-list
