Re: How to separate this line in udev rules file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I believe udev rules are processed as 'last one rules them all' and so
if you put your modified version into a file called something like
99-my-multipath.rules it will stick. The important part is the "99".


Someone will correct me if I am wrong but I think that's how it works.


-C


On Fri, Jun 3, 2011 at 10:28 PM, Yong Huang <yong321@xxxxxxxxx> wrote:
> 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
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux