1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#!/bin/sh
set -e
WATCHER_CONF=/etc/watcher/watcher.conf
#PKGOS-INCLUDE#
if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then
. /usr/share/debconf/confmodule
. /usr/share/dbconfig-common/dpkg/postinst
pkgos_var_user_group watcher
# Needed at runtime
mkdir -p /var/cache/watcher
chown watcher:watcher /var/cache/watcher
pkgos_write_new_conf watcher policy.json
pkgos_write_new_conf watcher watcher.conf
db_get watcher/configure_db
if [ "$RET" = "true" ]; then
pkgos_dbc_postinst ${WATCHER_CONF} database connection watcher $@
fi
pkgos_rabbit_write_conf ${WATCHER_CONF} oslo_messaging_rabbit watcher
pkgos_write_admin_creds ${WATCHER_CONF} keystone_authtoken watcher
db_get watcher/configure_db
if [ "$RET" = "true" ]; then
echo "Now calling watcher-db-manage --config-file /etc/watcher/watcher.conf create_schema: this may take a while..."
su -s /bin/sh -c 'watcher-db-manage --config-file /etc/watcher/watcher.conf create_schema' watcher
fi
db_stop
fi
#DEBHELPER#
exit 0
|