"We were attempting variants of 'while true; do sudo multipath -F; sudo multipath -v4 ; done' to create a set of udev add/remove events and noticed that shortly after starting, no output appeared within the 'udevadm monitor' command."
So it appears that multipath is sending a DM ioctl to create a map with the same wwid,
that "should" have been completely removed at the exit of 'multipath -F'. There's
no dmsetup command executing out of band unless there's some udev rule misbehaving.
The udev rules managing dmsetup are /lib/udev/rules.d/55-dm.rules
I'm not familiar with the cookie feature you mentioned, but we appear to have some of the
capability here. I haven't compared it to upstream yet.
"55-dm.rules"
# Decode udev control flags and set environment variables appropriately.
# These flags are encoded in DM_COOKIE variable that was introduced in
# kernel version 2.6.31. Therefore, we can use this feature with
# kernels >= 2.6.31 only.
ENV{DM_COOKIE}=="?*", IMPORT{program}="/sbin/dmsetup udevflags $env{DM_COOKIE}"
ENV{DM_COOKIE}=="?*", RUN+="/sbin/dmsetup udevcomplete $env{DM_COOKIE}"
@Alasdair
It's buried in the description:
"We were attempting variants of 'while true; do sudo multipath -F; sudo multipath -v4 ; done' to create a set of udev add/remove events and noticed that shortly after starting, no output appeared within the 'udevadm monitor' command."
So it appears that multipath is sending a DM ioctl to create a map with the same wwid,
that "should" have been completely removed at the exit of 'multipath -F'. There's
no dmsetup command executing out of band unless there's some udev rule misbehaving.
The udev rules managing dmsetup are /lib/udev/ rules.d/ 55-dm.rules
I'm not familiar with the cookie feature you mentioned, but we appear to have some of the
capability here. I haven't compared it to upstream yet.
"55-dm.rules"
# Decode udev control flags and set environment variables appropriately. COOKIE} =="?*", IMPORT{ program} ="/sbin/ dmsetup udevflags $env{DM_COOKIE}" COOKIE} =="?*", RUN+="/sbin/dmsetup udevcomplete $env{DM_COOKIE}"
# These flags are encoded in DM_COOKIE variable that was introduced in
# kernel version 2.6.31. Therefore, we can use this feature with
# kernels >= 2.6.31 only.
ENV{DM_
ENV{DM_
and compared to our packaged source in precise:
<12:29: 34>multipath- tools-0. 4.9$ grep -R cookie . devmapper. c:dm_simplecmd (int task, const char *name, int no_flush, uint32_t *cookie) { devmapper. c: if (udev_wait_flag && !dm_task_ set_cookie( dmt, cookie, 0)) devmapper. c: mode_t mode, uid_t uid, gid_t gid, uint32_t *cookie) { devmapper. c: if (task == DM_DEVICE_CREATE && !dm_task_ set_cookie( dmt, cookie, 0)) wait(cookie) ; config. h: uint32_t cookie; devmapper. c: if (udev_wait_flag && !dm_task_ set_cookie( dmt, &conf->cookie, 0)) devmapper. c: !dm_task_ set_cookie( dmt, &conf->cookie, 0)) devmapper. c: if (!dm_task_ set_cookie( dmt, &conf->cookie, 0)) wait(conf- >cookie) ;
./kpartx/
./kpartx/
./kpartx/
./kpartx/
./kpartx/kpartx.c: uint32_t cookie = 0;
./kpartx/kpartx.c: 0, &cookie)) {
./kpartx/kpartx.c: buf.st_gid, &cookie)) {
./kpartx/kpartx.c: 1, &cookie)) {
./kpartx/kpartx.c: &cookie);
./kpartx/kpartx.c: &cookie);
./kpartx/kpartx.c: dm_udev_
./libmultipath/
./libmultipath/
./libmultipath/
./libmultipath/
./multipath/main.c: dm_udev_
This cookie mechanism is news to me, I'll take a closer look, thanks.