Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-04-04 14:52:36 -0400
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-04-04 14:52:36 -0400
commit6f5796238a2102b2fb05cc15422abcbe7bf228de (patch)
tree9836872308e799b1349ca0e7c00e2439e45789bf /bin
parent1a35232bd8c96a2938a11356184019971823f2c9 (diff)
downloadtame-6f5796238a2102b2fb05cc15422abcbe7bf228de.tar.gz
tame-6f5796238a2102b2fb05cc15422abcbe7bf228de.tar.bz2
tame-6f5796238a2102b2fb05cc15422abcbe7bf228de.zip
tame: Create guard parent directory
It may not exist on certain systems (e.g. build containers).
Diffstat (limited to 'bin')
-rwxr-xr-xbin/tame7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/tame b/bin/tame
index a022320..b2cae7b 100755
--- a/bin/tame
+++ b/bin/tame
@@ -299,6 +299,9 @@ start-tamed-safe()
local -r root=${1?Missing root}
local -ri timeout=5
+ local -r guard="$root-guard"
+
+ mkdir -p "$( dirname "$root" )"
(
flock -w $timeout 6 || {
@@ -309,8 +312,8 @@ start-tamed-safe()
_start-tamed "$root"
flock -u 6
- rm -f "$root-guard"
- ) 6>"$root-guard"
+ rm -f "$guard"
+ ) 6>"$guard"
}