FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Red Hat Linux

 
 
LinkBack Thread Tools
 
Old 06-03-2011, 09:28 PM
Yong Huang
 
Default How to separate this line in udev rules file

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@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 06-04-2011, 06:47 AM
Corey Kovacs
 
Default How to separate this line in udev rules file

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@yahoo.com> 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@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>

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

Thread Tools




All times are GMT. The time now is 03:59 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org