1
# maas-cluster - provisioning service
3
# MAAS Provisioning Service
6
author "Andres Rodriguez <andres.rodriguez@canonical.com>"
8
start on filesystem and net-device-up
13
env CONFIG_FILE=/etc/maas/maas_cluster.conf
16
if [ ! -f $CONFIG_FILE ]; then
17
echo "$CONFIG_FILE does not exist. Aborting."
24
# Exit immediately on error, and treat unset variables as errors. In
25
# sh/dash, unfortunately, the following does not cause the use of an unset
26
# variable to halt the script, it merely prints an error and sets $?.
27
set -o errexit -o nounset
28
# Load the configuration file.
30
# The MAAS cluster controller needs both CLUSTER_UUID and MAAS_URL to
34
# Check for the shared-secret. If it's not here, sleep for a while, then
35
# exit and allow respawn to do its thing.
36
if ! maas-provision check-for-shared-secret >/dev/null; then
37
fmt -w 72 <<-'EOF' >&2
38
A shared secret has not been installed for this cluster. Obtain
39
the secret from the region (find it in /var/lib/maas/secret once
40
the region controller has started for the first time) and
41
install it with `maas-provision install-shared-secret`.
43
However, if this machine is also serving as the region, ensure
44
that the region controller is started (`sudo service apache2
45
start` typically). It will create the shared secret, which
46
maas-clusterd will then find when it respawns in 5 seconds.
51
# To add options to your daemon, edit the line below:
52
exec /usr/bin/authbind --deep /usr/bin/twistd \
53
--nodaemon --uid=maas --gid=maas --pidfile=/run/maas-cluster.pid \
54
--logfile=/dev/null maas-pserv --config-file=/etc/maas/pserv.yaml