~andreserl/maas/packaging_1.9.0rc1

« back to all changes in this revision

Viewing changes to debian/maas-cluster-controller.maas-clusterd.upstart

[r=andreserl][bug=][author=allenap] Use new local configuration support for the cluster.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
respawn
8
8
 
9
 
env CONFIG_FILE=/etc/maas/maas_cluster.conf
10
9
env LOGFILE=/var/log/maas/clusterd.log
11
10
 
12
 
pre-start script
13
 
    if [ ! -f $CONFIG_FILE ]; then
14
 
        echo "$CONFIG_FILE does not exist.  Aborting."
15
 
        stop
16
 
        exit 0
17
 
    fi
18
 
end script
19
 
 
20
11
script
21
12
    # Exit immediately on error, and treat unset variables as errors. In
22
13
    # sh/dash, unfortunately, the following does not cause the use of an unset
23
14
    # variable to halt the script, it merely prints an error and sets $?.
24
15
    set -o errexit -o nounset
25
 
    # Load the configuration file.
26
 
    . $CONFIG_FILE
27
 
    # The MAAS cluster controller needs both CLUSTER_UUID and MAAS_URL to
28
 
    # operate.
29
 
    export CLUSTER_UUID
30
 
    export MAAS_URL
31
16
    # Check for the shared-secret. If it's not here, sleep for a while, then
32
17
    # exit and allow respawn to do its thing.
33
18
    if ! maas-provision check-for-shared-secret >/dev/null; then
48
33
    # To add options to your daemon, edit the line below:
49
34
    exec /usr/bin/authbind --deep \
50
35
        /usr/bin/twistd --nodaemon --uid=maas --gid=maas --pidfile= \
51
 
        maas-clusterd --config-file=/etc/maas/pserv.yaml > ${LOGFILE} 2>&1
 
36
        maas-clusterd > ${LOGFILE} 2>&1
52
37
end script