diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2016-09-17 01:52:49 +0300 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2016-09-17 01:52:49 +0300 |
commit | 6122e4a3242ee0fb17da84f91e806879e532cec3 (patch) | |
tree | d4598d1bc5678be62c955fb1dd1741d51fb7ad24 /plugins.d/loopsleepms.sh.inc | |
parent | e65842fdc286ab683187343d8e2c0d7d2761c5bb (diff) |
prevent multiple threads from removing and creating the fifo file
Diffstat (limited to 'plugins.d/loopsleepms.sh.inc')
-rw-r--r-- | plugins.d/loopsleepms.sh.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins.d/loopsleepms.sh.inc b/plugins.d/loopsleepms.sh.inc index 3112d03357..55a75bfa4e 100644 --- a/plugins.d/loopsleepms.sh.inc +++ b/plugins.d/loopsleepms.sh.inc @@ -83,8 +83,8 @@ fi mysleep="mysleep_read" mysleep_fifo="${NETDATA_CACHE_DIR-/tmp}/.netdata_bash_sleep_timer_fifo" -[ -e "${mysleep_fifo}" ] && rm "${mysleep_fifo}" -mkfifo "${mysleep_fifo}" || mysleep="sleep" +[ ! -e "${mysleep_fifo}" ] && mkfifo "${mysleep_fifo}" +[ ! -e "${mysleep_fifo}" ] && mysleep="sleep" mysleep_read() { read -t "${1}" <>"${mysleep_fifo}" |