05f23656 |
# lib/template
# Functions to control the configuration and operation of the XXXX service
# <do not include this template file in ``stack.sh``!>
# Dependencies: |
6a5aa7c6 |
#
# - ``functions`` file
# - ``SERVICE_{TENANT_NAME|PASSWORD}`` must be defined
# - <list other global vars that are assumed to be defined> |
05f23656 |
# ``stack.sh`` calls the entry points in this order:
# |
e4fa7213 |
# - is_XXXX_enabled |
6a5aa7c6 |
# - install_XXXX
# - configure_XXXX
# - init_XXXX
# - start_XXXX
# - stop_XXXX
# - cleanup_XXXX |
05f23656 |
|
7903b795 |
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set +o xtrace |
05f23656 |
# Defaults
# --------
# <define global variables here that belong to this project>
# Set up default directories
XXXX_DIR=$DEST/XXXX
XXX_CONF_DIR=/etc/XXXX
# Entry Points
# ------------
|
e4fa7213 |
# Test if any XXXX services are enabled
# is_XXXX_enabled
function is_XXXX_enabled {
[[ ,${ENABLED_SERVICES} =~ ,"XX-" ]] && return 0
return 1
}
|
05f23656 |
# cleanup_XXXX() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up |
aee18c74 |
function cleanup_XXXX { |
05f23656 |
# kill instances (nova)
# delete image files (glance)
# This function intentionally left blank
:
}
# configure_XXXX() - Set config files, create data dirs, etc |
aee18c74 |
function configure_XXXX { |
05f23656 |
# sudo python setup.py deploy
# iniset $XXXX_CONF ...
# This function intentionally left blank
:
}
# init_XXXX() - Initialize databases, etc. |
aee18c74 |
function init_XXXX { |
05f23656 |
# clean up from previous (possibly aborted) runs
# create required data files
:
}
# install_XXXX() - Collect source and prepare |
aee18c74 |
function install_XXXX { |
05f23656 |
# git clone xxx
:
}
# start_XXXX() - Start running processes, including screen |
aee18c74 |
function start_XXXX { |
05f23656 |
# screen_it XXXX "cd $XXXX_DIR && $XXXX_DIR/bin/XXXX-bin"
:
}
# stop_XXXX() - Stop running processes (non-screen) |
aee18c74 |
function stop_XXXX { |
05f23656 |
# FIXME(dtroyer): stop only our screen screen window?
:
} |
7903b795 |
# Restore xtrace
$XTRACE |
584d90ec |
|
6a5aa7c6 |
# Tell emacs to use shell-script-mode
## Local variables:
## mode: shell-script
## End: |