blob: 72904fe1c626b01961a90dfb11a06d98bc110cad [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:
6# ``functions`` file
7# ``SERVICE_{TENANT_NAME|PASSWORD}`` must be defined
8# <list other global vars that are assumed to be defined>
9
10# ``stack.sh`` calls the entry points in this order:
11#
12# install_XXXX
13# configure_XXXX
14# init_XXXX
15# start_XXXX
16# stop_XXXX
17# cleanup_XXXX
18
Dean Troyer7903b792012-09-13 17:16:12 -050019# Save trace setting
20XTRACE=$(set +o | grep xtrace)
21set +o xtrace
Dean Troyer05f23652012-08-29 15:20:21 -050022
23
24# Defaults
25# --------
26
27# <define global variables here that belong to this project>
28
29# Set up default directories
30XXXX_DIR=$DEST/XXXX
31XXX_CONF_DIR=/etc/XXXX
32
33
34# Entry Points
35# ------------
36
37# cleanup_XXXX() - Remove residual data files, anything left over from previous
38# runs that a clean run would need to clean up
39function cleanup_XXXX() {
40 # kill instances (nova)
41 # delete image files (glance)
42 # This function intentionally left blank
43 :
44}
45
46# configure_XXXX() - Set config files, create data dirs, etc
47function configure_XXXX() {
48 # sudo python setup.py deploy
49 # iniset $XXXX_CONF ...
50 # This function intentionally left blank
51 :
52}
53
54# init_XXXX() - Initialize databases, etc.
55function init_XXXX() {
56 # clean up from previous (possibly aborted) runs
57 # create required data files
58 :
59}
60
61# install_XXXX() - Collect source and prepare
62function install_XXXX() {
63 # git clone xxx
64 :
65}
66
67# start_XXXX() - Start running processes, including screen
Dean Troyer1de40cf2012-09-04 14:19:24 -050068function start_XXXX() {
Dean Troyer05f23652012-08-29 15:20:21 -050069 # screen_it XXXX "cd $XXXX_DIR && $XXXX_DIR/bin/XXXX-bin"
70 :
71}
72
73# stop_XXXX() - Stop running processes (non-screen)
74function stop_XXXX() {
75 # FIXME(dtroyer): stop only our screen screen window?
76 :
77}
Dean Troyer7903b792012-09-13 17:16:12 -050078
79# Restore xtrace
80$XTRACE
Sean Dague584d90e2013-03-29 14:34:53 -040081
82# Local variables:
83# mode: shell-script
84# End: