Skip to content

Commit

Permalink
[coreos] Adding warning/failover to 'status' command to prevent socke…
Browse files Browse the repository at this point in the history
…t connection refused.
  • Loading branch information
John Zeller committed Jul 22, 2015
1 parent 28333fa commit a5dda4a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
15 changes: 14 additions & 1 deletion packaging/centos/datadog-agent.init
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,20 @@ case "$1" in
restart
;;
status)
check_status
# Note: sh does not support arrays
# Check for kernel version 3.18+ - overlayfs has known bug affecting unix domain sockets
major=$(echo "$( uname -r )" | cut -d"." -f1)
minor=$(echo "$( uname -r )" | cut -d"." -f2)
# If major version 3, and minor version 18+, OR major version 4+
if ( [ $major -eq 3 ] && [ $minor -ge 18 ] ) || [ $major -gt 3 ]; then
RED='\033[0;31m' # Red Text
NC='\033[0m' # No Color
echo "${RED}Warning: Known bug in Linux Kernel 3.18+ causes 'status' to fail.${NC}"
echo "Calling 'info', instead..."
service datadog-agent info
else
check_status
fi
;;
info)
info "$@"
Expand Down
16 changes: 15 additions & 1 deletion packaging/debian/datadog-agent.init
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,21 @@ case "$1" in
;;

status)
check_status
# Note: sh does not support arrays
# Check for kernel version 3.18+ - overlayfs has known bug affecting unix domain sockets
major=$(echo "$( uname -r )" | cut -d"." -f1)
minor=$(echo "$( uname -r )" | cut -d"." -f2)
# If major version 3, and minor version 18+, OR major version 4+
if ( [ $major -eq 3 ] && [ $minor -ge 18 ] ) || [ $major -gt 3 ]; then
RED='\033[0;31m' # Red Text
NC='\033[0m' # No Color
echo "${RED}Warning: Known bug in Linux Kernel 3.18+ causes 'status' to fail.${NC}"
echo "Calling 'info', instead..."
service datadog-agent info
else
check_status
fi
exit $?
;;

restart|force-reload)
Expand Down

0 comments on commit a5dda4a

Please sign in to comment.