aboutsummaryrefslogtreecommitdiffstats
path: root/keystone-moon/debian/keystone.cron.hourly
diff options
context:
space:
mode:
authorThomas Duval <thomas.duval@orange.com>2016-08-01 17:29:50 +0200
committerThomas Duval <thomas.duval@orange.com>2016-08-01 17:29:50 +0200
commit860e7fd7b81f956b54b25224efbd69ff9b1d1cc7 (patch)
treeea31fbc59c7897261be1f935d4a4d2e6f9517331 /keystone-moon/debian/keystone.cron.hourly
parentf229ce96c7ce192db501b0da538e9b8c8ec7f1d1 (diff)
Update script for debian package creation.
Change-Id: I0860633b9dc1aedd89e0272b92cb17022d35d01c
Diffstat (limited to 'keystone-moon/debian/keystone.cron.hourly')
-rw-r--r--keystone-moon/debian/keystone.cron.hourly16
1 files changed, 16 insertions, 0 deletions
diff --git a/keystone-moon/debian/keystone.cron.hourly b/keystone-moon/debian/keystone.cron.hourly
new file mode 100644
index 00000000..b372e9d1
--- /dev/null
+++ b/keystone-moon/debian/keystone.cron.hourly
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+if [ -x /usr/bin/keystone-manage ] ; then
+ # We should only run token_flush if we're using uuid tokens.
+ PROVIDER=$(grep -E '^[ \t]*provider[ \t]*=' /etc/keystone/keystone.conf | true)
+ if [ -n "${PROVIDER}" ] ; then
+ PROVIDER=$(grep -E '^[ \t]*provider[ \t]*=' /etc/keystone/keystone.conf | sed -e 's/[ \t]*provider[ \t]*=//' | awk '{print $1}')
+ else
+ PROVIDER=uuid
+ fi
+ if [ "${PROVIDER}" = "uuid" ] ; then
+ su -c '/usr/bin/keystone-manage token_flush >/var/log/keystone/keystone-tokenflush.log 2>&1' keystone
+ fi
+fi