Reduce broken pipe errors (#7588)
* tc_broken_pipe: Add exit to tc-qos-helper.sh.in When Netdata received a kill -9 the script started from tc plugin using pipe stayed alive writting broken pipe, this PR reduces the number of messages * tc_broken_pipe: Missing exit This commit brings exit for lines that were not reporting errors
thiagoftsm committed
Jan 14, 2020 at 18:56 UTC
4d958b8cf2f30920272185933721a794eb303efc
1 file changed
+5
-5
collectors/tc.plugin/tc-qos-helper.sh.in
+5
-5
@@ -211,7 +211,7 @@ show_fireqos_names() {
211
212
if [ -f "${fireqos_run_dir}/ifaces/${x}" ]; then
213
name="$(<"${fireqos_run_dir}/ifaces/${x}")"
214
- echo "SETDEVICENAME ${name}"
214
+ echo "SETDEVICENAME ${name}" || exit
215
216
#shellcheck source=/dev/null
217
source "${fireqos_run_dir}/${name}.conf"
@@ -219,7 +219,7 @@ show_fireqos_names() {
219
# shellcheck disable=SC2086
220
setclassname ${n//|/ }
221
done
222
- [ -n "${interface_dev}" ] && echo "SETDEVICEGROUP ${interface_dev}"
222
+ [ -n "${interface_dev}" ] && echo "SETDEVICEGROUP ${interface_dev}" || exit
223
224
return 0
225
fi
@@ -230,7 +230,7 @@ show_fireqos_names() {
230
show_tc() {
231
local x="${1}"
232
233
- echo "BEGIN ${x}"
233
+ echo "BEGIN ${x}" || exit
234
235
# netdata can parse the output of tc
236
${tc} -s ${tc_show} show dev "${x}"
@@ -240,7 +240,7 @@ show_tc() {
240
show_fireqos_names "${x}" || show_tc_cls "${x}"
241
fi
242
243
- echo "END ${x}"
243
+ echo "END ${x}" || exit
244
}
245
246
find_tc_devices() {
@@ -289,7 +289,7 @@ while true; do
289
show_tc "${d}"
290
done
291
292
- echo "WORKTIME ${LOOPSLEEPMS_LASTWORK}"
292
+ echo "WORKTIME ${LOOPSLEEPMS_LASTWORK}" || exit
293
294
loopsleepms ${update_every}
295