How to separate this line in udev rules file

Yong Huang yong321 at yahoo.com
Fri Jun 3 21:28:47 UTC 2011


On my RHEL5.5 box, in the file /etc/udev/rules.d/40-multipath.rules, I have this line:

PROGRAM=="/sbin/dmsetup info -c --noheadings -o name -j %M -m %m", RESULT=="?*", NAME="%k", SYMLINK="mpath/%c", RUN+="/bin/bash -c '/sbin/mpath_wait /dev/mapper/%c; /sbin/kpartx -a -p p /dev/mapper/%c; /bin/chown oracle:dba /dev/mapper/%cp1; /bin/chmod 660 /dev/mapper/%cp1'"

It works perfectly. The original file did not have the chown and chmod part on this line. We added it.

Now a minor problem is that, whenever UDEV is patched, this file will be overwritten, and we have to manually add the chown and chmod back to that line in this file. I'd like to leave the file as original and create a separate rules file, say 41-mda_multipath.rules, where I have this line only:

PROGRAM=="/sbin/dmsetup info -c --noheadings -o name -j %M -m %m", RESULT=="?*", RUN+="/bin/bash -c '/sbin/mpath_wait /dev/mapper/%c; /sbin/kpartx -a -p p /dev/mapper/%c; /bin/chown oracle:dba /dev/mapper/%cp1; /bin/chmod 660 /dev/mapper/%cp1'"

But my test shows the ownership and modes of /dev/mapper/*cp1 device files are NOT changed. Anybody knowing UDEV better? Please advise. Thanks.

Yong Huang




More information about the redhat-list mailing list