无法弄清楚如何使 sm-notify 工作。
我已将具有相关 IPv4 的主机名条目添加到 /etc/hosts
$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
# ...
172.21.10.1 vast10_vip1
但由于“EADDRNOTAVAIL”错误, sm-notify 仍然失败
$ sudo sm-notify -f -d -v 172.21.10.1 -m 1
sm-notify: Version 1.3.0 starting
sm-notify: Canonical name for my_name '172.21.10.1': vast10_vip1
sm-notify: Added host 172.21.10.7 to notify list
sm-notify: Added host 172.21.10.2 to notify list
sm-notify: Added host 172.21.10.10 to notify list
sm-notify: Added host 172.21.10.8 to notify list
sm-notify: Added host 172.21.10.14 to notify list
sm-notify: Added host 172.21.10.4 to notify list
sm-notify: Added host 172.21.10.6 to notify list
sm-notify: Added host 172.21.10.5 to notify list
sm-notify: Added host 172.21.10.12 to notify list
sm-notify: Added host 172.21.10.15 to notify list
sm-notify: Added host 172.21.10.9 to notify list
sm-notify: Added host 172.21.10.11 to notify list
sm-notify: Added host 172.21.10.3 to notify list
sm-notify: Added host 172.21.10.1 to notify list
sm-notify: Added host 172.21.10.13 to notify list
sm-notify: bindresvport on RPC socket failed: Cannot assign requested address
将输出粘贴到此strace
处以获取更多详细信息:
103494 [00007f77fbd73027] socket(AF_INET6, SOCK_DGRAM, IPPROTO_IP) = 3 <0.000014>
103494 [00007f77fbd72b97] bind(3, {sa_family=AF_INET6, sin6_port=htons(638), inet_pton(AF_INET6, "::ffff:172.21.10.1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1
EADDRNOTAVAIL (Cannot assign requested address) <0.000014>
103494 [00007f77fbd62fd0] write(2, "bindresvport on RPC socket failed: Cannot assign requested address", 66) = 66 <0.000019>
sm-notify 是否会尝试通过 IPv6 地址而不是 IPv4 进行绑定?