[multipath] Check for root privilege before running. Avoids failing on first DM ioctl. --- commit fc5ecfd8aad677d00c6d7141072372f56d19b9fe tree 8fe95d5e1baa37878aa755e67c79e3811a3c1b22 parent b9160d7d40c162d9fe385338570836257a6cbe65 author Christophe Varoqui 1114989466 -0700 committer Christophe Varoqui 1114989466 -0700 Index: multipath/main.c =================================================================== --- 2de11a7b1457c9c137355cb304249d3653cf7d5d/multipath/main.c (mode:100644 sha1:52d3b8a8cdf8ffa26445d0999cc6852bf59a4e59) +++ 8fe95d5e1baa37878aa755e67c79e3811a3c1b22/multipath/main.c (mode:100644 sha1:b5d4cca7e6bb0bb9a03d8a35a849e56e9eb10d18) @@ -856,6 +856,11 @@ extern int optind; char * refwwid = NULL; + if (getuid() != 0) { + fprintf(stderr, "need to be root\n"); + exit(1); + } + if (dm_prereq(DEFAULT_TARGET, 1, 0, 3)) { condlog(0, "device mapper prerequisites not met"); exit(1); Index: multipathd/main.c =================================================================== --- 2de11a7b1457c9c137355cb304249d3653cf7d5d/multipathd/main.c (mode:100644 sha1:0f36b77de03baf462eec733157a7b520642df6b3) +++ 8fe95d5e1baa37878aa755e67c79e3811a3c1b22/multipathd/main.c (mode:100644 sha1:52df71d8e14bcfb1840c745c0fa6185392d27b85) @@ -998,7 +998,7 @@ void * child_stack; if (getuid() != 0) { - fprintf(stderr, "need to be root, exit"); + fprintf(stderr, "need to be root\n"); exit(1); } !-------------------------------------------------------------flip- [libmultipath] Clariion arrays need the "queue_if_no_path" feature for the system to survive a firmware rolling upgrade. Set it by default in hwtable.c Suggested by Edward Goggin, EMC --- commit 9343f20f3a73b096650ff750f978137e40404e34 tree 587d111548cdd25740b9ae992a5792a25d469134 parent fc5ecfd8aad677d00c6d7141072372f56d19b9fe author Christophe Varoqui 1115067357 -0700 committer Christophe Varoqui 1115067357 -0700 Index: libmultipath/hwtable.c =================================================================== --- 8fe95d5e1baa37878aa755e67c79e3811a3c1b22/libmultipath/hwtable.c (mode:100644 sha1:0382c6f318186e13946733ac714d08df9c26af9b) +++ 587d111548cdd25740b9ae992a5792a25d469134/libmultipath/hwtable.c (mode:100644 sha1:cbe52c9b5e511e094330035ad654f3ffcd821f35) @@ -34,7 +34,8 @@ r += store_hwe(hw, "SUN", "T4", MULTIBUS, DEFAULT_GETUID); r += store_hwe_ext(hw, "DGC", "*", GROUP_BY_PRIO, DEFAULT_GETUID, - "/sbin/pp_emc /dev/%n", "1 emc", "0", "emc_clariion"); + "/sbin/pp_emc /dev/%n", "1 emc", "1 queue_if_no_path", + "emc_clariion"); r += store_hwe_ext(hw, "IBM", "3542", GROUP_BY_SERIAL, DEFAULT_GETUID, NULL, "0", "0", "tur"); r += store_hwe_ext(hw, "SGI", "TP9400", MULTIBUS, DEFAULT_GETUID, !-------------------------------------------------------------flip- [multipathd] Definitely kill the "initial map reconfigure" at daemon startup. The daemon shouldn't do surprising things like that. --- commit 2b907d9df520c800c807d9ffc1431b40fd0ede6b tree 9aef020a29ffea832a5cbaf056fe49077a57ea33 parent 9343f20f3a73b096650ff750f978137e40404e34 author Christophe Varoqui 1115067934 -0700 committer Christophe Varoqui 1115067934 -0700 Index: multipathd/main.c =================================================================== --- 587d111548cdd25740b9ae992a5792a25d469134/multipathd/main.c (mode:100644 sha1:52df71d8e14bcfb1840c745c0fa6185392d27b85) +++ 9aef020a29ffea832a5cbaf056fe49077a57ea33/multipathd/main.c (mode:100644 sha1:b90650e19da035069830f1b6d042310d96ae192d) @@ -432,7 +432,6 @@ struct event_thread *wp; pthread_attr_t attr; int r; - char buff[1]; int i, j; mlockall(MCL_CURRENT | MCL_FUTURE); @@ -467,9 +466,6 @@ sleep(5); } - log_safe(LOG_NOTICE, "initial reconfigure multipath maps"); -// execute_program(conf->multipath, buff, 1); - while (1) { /* * revoke the leases !-------------------------------------------------------------flip- [multipathd] Log only once the failure messages in loops. Should close https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=156641 --- commit 457b498a392a61a0198b5dea80972930069d0537 tree 2540760936576d6c6596f60bb6c9417dc5edde41 parent 2b907d9df520c800c807d9ffc1431b40fd0ede6b author Christophe Varoqui 1115068788 -0700 committer Christophe Varoqui 1115068788 -0700 Index: multipathd/main.c =================================================================== --- 9aef020a29ffea832a5cbaf056fe49077a57ea33/multipathd/main.c (mode:100644 sha1:b90650e19da035069830f1b6d042310d96ae192d) +++ 2540760936576d6c6596f60bb6c9417dc5edde41/multipathd/main.c (mode:100644 sha1:3db1e4722ab8390d4c256d3ac5c6976a7c6aa15d) @@ -431,7 +431,7 @@ vector waiters; struct event_thread *wp; pthread_attr_t attr; - int r; + int r = 1; int i, j; mlockall(MCL_CURRENT | MCL_FUTURE); @@ -459,12 +459,16 @@ /* * update paths list */ - log_safe(LOG_INFO, "fetch paths list"); - while(path_discovery_locked(allpaths, sysfs_path)) { - log_safe(LOG_ERR, "can't update path list ... retry"); + if (r) { + /* log only once */ + log_safe(LOG_ERR, "can't update path list ... retry"); + r = 0; + } sleep(5); } + log_safe(LOG_INFO, "path list updated"); + while (1) { /* @@ -476,8 +480,6 @@ /* * update multipaths list */ - log_safe(LOG_INFO, "refresh multipaths list"); - if (mpvec) free_multipathvec(mpvec, KEEP_PATHS); @@ -490,9 +492,14 @@ if (mpvec && !get_dm_mpvec(mpvec, allpaths)) break; - log_safe(LOG_ERR, "can't get mpvec ... retry"); + if (!r) { + /* log only once */ + log_safe(LOG_ERR, "can't get mpvec ... retry"); + r = 1; + } sleep(5); } + log_safe(LOG_INFO, "multipath list updated"); /* * start waiters on all mpvec !-------------------------------------------------------------flip-