aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-08-04 17:09:53 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-08-04 17:19:15 +0200
commitd48508b4afe5f3a22c2dda733ee13554d5c5ae60 (patch)
tree049b84a167350236c52ce956a32eae824a092d43 /scripts
parentf4c8d96dd93b7cdaafbb5d858268266ef4edb2ae (diff)
Improved nDPIsrvd buffer bloat handling using caching.
* still allow blocking mode (with send timeout) * improved daemon start/stop test script Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/daemon.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/daemon.sh b/scripts/daemon.sh
index 86e4d5aea..2cd7b4389 100755
--- a/scripts/daemon.sh
+++ b/scripts/daemon.sh
@@ -18,13 +18,17 @@ if [ -r "/tmp/nDPId-${NSUFFIX}.pid" -o -r "/tmp/nDPIsrvd-${NSUFFIX}.pid" ]; then
nDPIsrvd_PID="$(cat "/tmp/nDPIsrvd-${NSUFFIX}.pid" 2>/dev/null)"
if [ x"${nDPId_PID}" != x ]; then
- sudo kill "${nDPId_PID}"
+ sudo kill "${nDPId_PID}" 2>/dev/null || true
+ while ps -p "${nDPId_PID}" > /dev/null; do sleep 1; done
+ rm -f "/tmp/nDPId-${NSUFFIX}.pid"
else
printf '%s\n' "${1} not started .." >&2
fi
if [ x"${nDPIsrvd_PID}" != x ]; then
- kill "${nDPIsrvd_PID}"
+ kill "${nDPIsrvd_PID}" 2>/dev/null || true
+ while ps -p "${nDPIsrvd_PID}" > /dev/null; do sleep 1; done
+ rm -f "/tmp/nDPIsrvd-${NSUFFIX}.pid" "/tmp/nDPIsrvd-${NSUFFIX}-collector.sock" "/tmp/nDPIsrvd-${NSUFFIX}-distributor.sock"
else
printf '%s\n' "${2} not started .." >&2
fi