Skip to content

Commit

Permalink
netdata/packaging/ci: Make timeout usage more cross-distro compliant (#…
Browse files Browse the repository at this point in the history
…5938)

* netdata/packaging/ci: #5935 - Make timeout usage more cross-distro compliant

* netdata/collectors: use existing system info variable NETDATA_SYSTEM_OS_ID
  • Loading branch information
paulkatsoulakis committed May 2, 2019
1 parent 8f36f5b commit c16181c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion collectors/charts.d.plugin/charts.d.plugin.in
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,14 @@ run() {
if [ "z${1}" = "z-t" -a "${2}" != "0" ]; then
t="${2}"
shift 2
timeout ${t} "${@}" 2>"${TMP_DIR}/run.${pid}"
case "${NETDATA_SYSTEM_OS_ID}" in
"alpine")
timeout -t ${t} "${@}" 2>"${TMP_DIR}/run.${pid}"
;;
*)
timeout ${t} "${@}" 2>"${TMP_DIR}/run.${pid}"
;;
esac
ret=$?
else
"${@}" 2>"${TMP_DIR}/run.${pid}"
Expand Down

0 comments on commit c16181c

Please sign in to comment.