Bug 105678 - ping's exit code could be more useful
ping's exit code could be more useful
Product: Red Hat Linux
Classification: Retired
Component: iputils (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Phil Knirsch
Mike McLean
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2003-09-26 10:46 EDT by Adam Spiers
Modified: 2015-03-04 20:12 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-04-22 09:17:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Adam Spiers 2003-09-26 10:46:04 EDT
If you specify both -c and -w switches, and the exit
code is 1, you don't know whether the host is alive
or not just by the exit code, since either no reply
packets have been received, or some reply packets *were*
recieved but the program timed out before the *full*
quota of packets expected in the -c value were received
(e.g. with -c 5 any number of replies between 1 and 4
would result in an exit code of 1).

That means that you have to look at STDOUT to determine
whether a host was alive, which makes scripting etc.
a lot more awkward.
Comment 1 Phil Knirsch 2004-04-22 09:17:57 EDT
Why don't you use -c 1 -W 10 for example then? This should do what you
want as if it fails then the host was not reachable, otherwise it was

Read ya, Phil

Note You need to log in before you can comment on or make changes to this bug.