From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wim Colgate" Subject: simple question... to tough to answer? Date: Thu, 15 May 2008 10:09:35 -0700 Message-ID: <7BC3A7DB53028743B733D298244A8C626E3A0D@sjcpexch02.citrite.net> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1627070788==" Return-path: Content-class: urn:content-classes:message List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: dm-devel@redhat.com List-Id: dm-devel.ids This is a multi-part message in MIME format. --===============1627070788== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C8B6AE.76A87F0E" This is a multi-part message in MIME format. ------_=_NextPart_001_01C8B6AE.76A87F0E Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, =20 I'm not quite sure why no one in the community hasn't been able to answer my questions.=20 =20 Simply (re)stated: =20 1) Are there hooks for dm/multipath events to notify software? 2) does path down/up fire up udev rules? =20 Thanks, =20 Wim ------_=_NextPart_001_01C8B6AE.76A87F0E Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

I’m not quite sure why no one in the = community hasn’t been able to answer my questions.

 

Simply (re)stated:

 

1) Are there hooks for dm/multipath events to = notify software?

2) does path down/up fire up udev = rules?

 

Thanks,

 

Wim

------_=_NextPart_001_01C8B6AE.76A87F0E-- --===============1627070788== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============1627070788==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: malahal@us.ibm.com Subject: Re: simple question... to tough to answer? Date: Thu, 15 May 2008 10:46:29 -0700 Message-ID: <20080515174629.GA8808@us.ibm.com> References: <7BC3A7DB53028743B733D298244A8C626E3A0D@sjcpexch02.citrite.net> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <7BC3A7DB53028743B733D298244A8C626E3A0D@sjcpexch02.citrite.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: dm-devel@redhat.com List-Id: dm-devel.ids Wim Colgate [Wim.Colgate@citrix.com] wrote: > Hi, > Simply (re)stated: > 1) Are there hooks for dm/multipath events to notify software? Not that I know of, but multipath uses uevets, so you can have your own daemon listening. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Subject: Re: simple question... to tough to answer? Date: Thu, 15 May 2008 13:54:11 -0400 Message-ID: <20080515175411.GA12985@mars.virtualiron.com> References: <7BC3A7DB53028743B733D298244A8C626E3A0D@sjcpexch02.citrite.net> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="tKW2IUtsqtDRztdT" Return-path: Content-Disposition: inline In-Reply-To: <7BC3A7DB53028743B733D298244A8C626E3A0D@sjcpexch02.citrite.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: device-mapper development List-Id: dm-devel.ids --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, May 15, 2008 at 10:09:35AM -0700, Wim Colgate wrote: > Hi, > > > > I'm not quite sure why no one in the community hasn't been able to > answer my questions. Probably b/c folks are too busy.. > > > > Simply (re)stated: > > > > 1) Are there hooks for dm/multipath events to notify software? You can also listen to the NETLINK_DM socket and parse the data. But that complicated by the fact that there is only one socket that the kernel uses and it cannot be shared. > > 2) does path down/up fire up udev rules? Yes. I am attaching a simple program you can use to listen to the kobject uevents that get fired. You can also modify it to use NETLINK_DM instead of NETLINK_KOBJECT_UEVENT and see what comes out. --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="listen.c" #include #include #include #include #define MAX_PAYLOAD 1024 /* maximum payload size */ struct sockaddr_nl src_addr; int sock_fd; static char buff[MAX_PAYLOAD]; ssize_t buflen; int main () { sock_fd = socket (PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT); memset (&src_addr, 0, sizeof (src_addr)); src_addr.nl_family = AF_NETLINK; src_addr.nl_pid = getpid (); /* self pid */ src_addr.nl_groups = 0xffffffff; printf ("Listen..\n"); bind (sock_fd, (struct sockaddr *) &src_addr, sizeof (src_addr)); printf ("Receiving..\n"); while (1) { buflen = recv (sock_fd, &buff, sizeof (buff), 0); printf ("Got data: %d\n", buflen); int i, bufpos; char *key; for (i = 0, bufpos = 0; (bufpos < buflen) && i < MAX_PAYLOAD; i++) { key = &buff[bufpos]; printf ("[%s]\n", key); bufpos += strlen (key) + 1; } memset (&buff, 0, MAX_PAYLOAD); } /* Close Netlink Socket */ close (sock_fd); return 0; } --tKW2IUtsqtDRztdT Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --tKW2IUtsqtDRztdT-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Reinecke Subject: Re: simple question... to tough to answer? Date: Fri, 16 May 2008 13:19:13 +0200 Message-ID: <482D6DB1.5080709@suse.de> References: <7BC3A7DB53028743B733D298244A8C626E3A0D@sjcpexch02.citrite.net> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <7BC3A7DB53028743B733D298244A8C626E3A0D@sjcpexch02.citrite.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: device-mapper development List-Id: dm-devel.ids Hi Wim, Wim Colgate wrote: > Hi, >=20 > I=E2=80=99m not quite sure why no one in the community hasn=E2=80=99t b= een able to=20 > answer my questions. >=20 > Simply (re)stated: >=20 > 1) Are there hooks for dm/multipath events to notify software? >=20 Yes. There is the general dm_event mechanism (which I wouldn't recommend) or with newer kernels you'll get netlink events from multipath for any path-related events. > 2) does path down/up fire up udev rules? >=20 Not as such. As stated above we should be sending out netlink events for path up/down events, but to my knowledge no-one is taking advantage of them. Certainly not udev in its default setting nor multipath. Cheers, Hannes --=20 Dr. Hannes Reinecke zSeries & Storage hare@suse.de +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg GF: Markus Rex, HRB 16746 (AG N=C3=BCrnberg) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Anderson Subject: Re: simple question... to tough to answer? Date: Fri, 16 May 2008 08:27:07 -0700 Message-ID: <20080516152707.GA24657@linux.vnet.ibm.com> References: <7BC3A7DB53028743B733D298244A8C626E3A0D@sjcpexch02.citrite.net> <482D6DB1.5080709@suse.de> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <482D6DB1.5080709@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: device-mapper development List-Id: dm-devel.ids Hannes Reinecke wrote: > Hi Wim, > > Wim Colgate wrote: >> Hi, >> >> I???m not quite sure why no one in the community hasn???t been able to >> answer my questions. >> >> Simply (re)stated: >> >> 1) Are there hooks for dm/multipath events to notify software? >> > Yes. There is the general dm_event mechanism (which I wouldn't recommend) > or with newer kernels you'll get netlink events from multipath for any > path-related events. > You can look at the documentation in recent kernels trees to get an example of the event attributes provided with each event using the uevent interface: Documentation/device-mapper/dm-uevent.txt >> 2) does path down/up fire up udev rules? >> > Not as such. As stated above we should be sending out netlink events for > path up/down events, but to my knowledge no-one is taking advantage > of them. Certainly not udev in its default setting nor multipath. One should note that if using the the current git version of the multipath tools and one wants to experiment with additional events one would need to add a udev rule "(i.e., RUN+="socket:...") You can reference this previous email for context. http://article.gmane.org/gmane.linux.scsi/36165 On some what related note. With all the work around making sure we can run in low memory situations we should make a choice to use raw netlink interface or the udev abstract namespace socket. -andmike -- Michael Anderson andmike@linux.vnet.ibm.com From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Craig Simpson" Subject: RE: simple question... to tough to answer? Date: Thu, 5 Jun 2008 12:06:46 -0700 Message-ID: References: <7BC3A7DB53028743B733D298244A8C626E3A0D@sjcpexch02.citrite.net><482D6DB1.5080709@suse.de> <20080516152707.GA24657@linux.vnet.ibm.com> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Content-class: urn:content-classes:message In-Reply-To: <20080516152707.GA24657@linux.vnet.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: device-mapper development List-Id: dm-devel.ids By chance does anyone have a working configuration of some example of this working? I am not so interested in a SNMP trap. But if I could have it email/page me, now that would rock.=20 Craig -----Original Message----- From: dm-devel-bounces@redhat.com [mailto:dm-devel-bounces@redhat.com] On Behalf Of Mike Anderson Sent: Friday, May 16, 2008 8:27 AM To: device-mapper development Subject: Re: [dm-devel] simple question... to tough to answer? Hannes Reinecke wrote: > Hi Wim, > > Wim Colgate wrote: >> Hi, >> >> I???m not quite sure why no one in the community hasn???t been able to=20 >> answer my questions. >> >> Simply (re)stated: >> >> 1) Are there hooks for dm/multipath events to notify software? >> > Yes. There is the general dm_event mechanism (which I wouldn't recommend) > or with newer kernels you'll get netlink events from multipath for any > path-related events. > You can look at the documentation in recent kernels trees to get an example of the event attributes provided with each event using the uevent interface: Documentation/device-mapper/dm-uevent.txt >> 2) does path down/up fire up udev rules? >> > Not as such. As stated above we should be sending out netlink events for > path up/down events, but to my knowledge no-one is taking advantage > of them. Certainly not udev in its default setting nor multipath. One should note that if using the the current git version of the multipath tools and one wants to experiment with additional events one would need to add a udev rule "(i.e., RUN+=3D"socket:...") You can reference this previous email for context. http://article.gmane.org/gmane.linux.scsi/36165 On some what related note. With all the work around making sure we can run in low memory situations we should make a choice to use raw netlink interface or the udev abstract namespace socket. -andmike -- Michael Anderson andmike@linux.vnet.ibm.com -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel