Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Fixes errors like |
| 2 | sm-notify[1070]: DNS resolution of a.b.c.d..com failed; retrying later |
| 3 | This error will occur anytime sm-notify is run before the network if fully up, |
| 4 | which is happening more and more with parallel startup systems. |
| 5 | The res_init() call is simple, safe, quick, and a patch to use it should be |
| 6 | able to go upstream. Presumably the whole reason sm-notify tries several |
| 7 | times is to wait for possible changes to the network configuration, but without |
| 8 | calling res_init() it will never be aware of those changes |
| 9 | |
| 10 | Backported drom Fedora |
| 11 | |
| 12 | Upstream-Status: Pending |
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 14 | |
| 15 | |
| 16 | diff -up nfs-utils-1.2.3/utils/statd/sm-notify.c.orig nfs-utils-1.2.3/utils/statd/sm-notify.c |
| 17 | --- nfs-utils-1.2.3/utils/statd/sm-notify.c.orig 2010-09-28 08:24:16.000000000 -0400 |
| 18 | +++ nfs-utils-1.2.3/utils/statd/sm-notify.c 2010-10-15 16:44:43.487119601 -0400 |
| 19 | @@ -28,6 +28,9 @@ |
| 20 | #include <netdb.h> |
| 21 | #include <errno.h> |
| 22 | #include <grp.h> |
| 23 | +#include <netinet/in.h> |
| 24 | +#include <arpa/nameser.h> |
| 25 | +#include <resolv.h> |
| 26 | |
| 27 | #include "sockaddr.h" |
| 28 | #include "xlog.h" |
| 29 | @@ -84,6 +87,7 @@ smn_lookup(const char *name) |
| 30 | }; |
| 31 | int error; |
| 32 | |
| 33 | + res_init(); |
| 34 | error = getaddrinfo(name, NULL, &hint, &ai); |
| 35 | if (error != 0) { |
| 36 | xlog(D_GENERAL, "getaddrinfo(3): %s", gai_strerror(error)); |