blob: 629e11027139a1c0246623b38611e7d5e7b00ef3 [file] [log] [blame]
Dean Troyer05f23652012-08-29 15:20:21 -05001# lib/template
2# Functions to control the configuration and operation of the XXXX service
3# <do not include this template file in ``stack.sh``!>
4
5# Dependencies:
Adam Spiers6a5aa7c2013-10-24 11:27:02 +01006#
7# - ``functions`` file
8# - ``SERVICE_{TENANT_NAME|PASSWORD}`` must be defined
9# - <list other global vars that are assumed to be defined>
Dean Troyer05f23652012-08-29 15:20:21 -050010
11# ``stack.sh`` calls the entry points in this order:
12#
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010013# - install_XXXX
14# - configure_XXXX
15# - init_XXXX
16# - start_XXXX
17# - stop_XXXX
18# - cleanup_XXXX
Dean Troyer05f23652012-08-29 15:20:21 -050019
Dean Troyer7903b792012-09-13 17:16:12 -050020# Save trace setting
21XTRACE=$(set +o | grep xtrace)
22set +o xtrace
Dean Troyer05f23652012-08-29 15:20:21 -050023
24
25# Defaults
26# --------
27
28# <define global variables here that belong to this project>
29
30# Set up default directories
31XXXX_DIR=$DEST/XXXX
32XXX_CONF_DIR=/etc/XXXX
33
34
35# Entry Points
36# ------------
37
38# cleanup_XXXX() - Remove residual data files, anything left over from previous
39# runs that a clean run would need to clean up
40function cleanup_XXXX() {
41 # kill instances (nova)
42 # delete image files (glance)
43 # This function intentionally left blank
44 :
45}
46
47# configure_XXXX() - Set config files, create data dirs, etc
48function configure_XXXX() {
49 # sudo python setup.py deploy
50 # iniset $XXXX_CONF ...
51 # This function intentionally left blank
52 :
53}
54
55# init_XXXX() - Initialize databases, etc.
56function init_XXXX() {
57 # clean up from previous (possibly aborted) runs
58 # create required data files
59 :
60}
61
62# install_XXXX() - Collect source and prepare
63function install_XXXX() {
64 # git clone xxx
65 :
66}
67
68# start_XXXX() - Start running processes, including screen
Dean Troyer1de40cf2012-09-04 14:19:24 -050069function start_XXXX() {
Dean Troyer05f23652012-08-29 15:20:21 -050070 # screen_it XXXX "cd $XXXX_DIR && $XXXX_DIR/bin/XXXX-bin"
71 :
72}
73
74# stop_XXXX() - Stop running processes (non-screen)
75function stop_XXXX() {
76 # FIXME(dtroyer): stop only our screen screen window?
77 :
78}
Dean Troyer7903b792012-09-13 17:16:12 -050079
80# Restore xtrace
81$XTRACE
Sean Dague584d90e2013-03-29 14:34:53 -040082
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010083# Tell emacs to use shell-script-mode
84## Local variables:
85## mode: shell-script
86## End: