summaryrefslogtreecommitdiff
path: root/tests/tail-2/append-only.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tail-2/append-only.sh')
-rwxr-xr-xtests/tail-2/append-only.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/tail-2/append-only.sh b/tests/tail-2/append-only.sh
index 9da10ae9c..2ea5df1fe 100755
--- a/tests/tail-2/append-only.sh
+++ b/tests/tail-2/append-only.sh
@@ -21,6 +21,9 @@
print_ver_ tail
require_root_
+# Terminate any background tail process
+cleanup_() { kill $pid 2>/dev/null && wait $pid; }
+
chattr_a_works=1
touch f
chattr +a f 2>/dev/null || chattr_a_works=0
@@ -35,6 +38,7 @@ fi
for mode in '' '---disable-inotify'; do
sleep 1 & pid=$!
tail --pid=$pid -f $mode f || fail=1
+ cleanup_
done
chattr -a f 2>/dev/null