diff options
author | Leif Johansson <leifj@sunet.se> | 2015-02-24 11:13:47 +0100 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2015-02-24 11:13:47 +0100 |
commit | 7863ad617033064d6b5758d3d1f4bba32b9cc5dd (patch) | |
tree | 57cddfbc3b3ecbad158df496cb749bfc4ab355b7 /global/overlay/usr/local/bin | |
parent | c6af45e481b4e089d4d48cdf5ac0831204def912 (diff) | |
parent | bc70832f4c33a458f2e913af702823539b2da7a1 (diff) |
Merge branch 'master' of git://github.com/leifj/multiverse into multiverse
Diffstat (limited to 'global/overlay/usr/local/bin')
-rwxr-xr-x | global/overlay/usr/local/bin/run-cosmos | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/global/overlay/usr/local/bin/run-cosmos b/global/overlay/usr/local/bin/run-cosmos new file mode 100755 index 0000000..a37d49f --- /dev/null +++ b/global/overlay/usr/local/bin/run-cosmos @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Simplify running cosmos, with serialization if flock is available. +# + +set -e + +FLOCK=`which flock` + +if [ -x "$FLOCK" ]; then + ($FLOCK --exclusive --wait 60 9 || exit 1 + cosmos $* update + cosmos $* apply + )9>/var/lock/run-cosmos +else + cosmos $* update + cosmos $* apply +fi + +touch /var/run/last-cosmos-ok.stamp + +find /var/lib/puppet/reports/ -type f -mtime +10 | xargs rm -f |