Comment 0 for bug 1973606

Revision history for this message
Nobuto Murata (nobuto) wrote :

In config.yaml:

  ping_timeout:
    default: 2
    description: Timeout in seconds per ICMP request
    type: int

It suggests the timeout is *per request*. However, if ping_tries is set like 10 for example, the actual command will be executed is `ping -c 10 -w 2`. And it fails always because ping will exit before sending 10 packets because of `-w` as documented:

> -w deadline
> Specify a timeout, in seconds, before ping exits regardless
> of how many packets have been sent or received.

$ ping -c 10 -w 2 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=6.04 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=5.92 ms

--- 192.168.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 5.918/5.976/6.035/0.058 ms

[src/lib/charms/layer/magpie_tools.py]
    ping_string = "ping -c {} -w {} {} {} > /dev/null 2>&1"\

I suppose the expected option here is `-W` (capital w).

> -W timeout
> Time to wait for a response, in seconds.