~ubuntu-branches/ubuntu/utopic/maas/utopic-security

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# Copyright 2012 Canonical Ltd.  This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).

# Exit immediately if a command exits with a non-zero status.
set -o errexit
# Treat unset variables as an error when substituting.
set -o nounset

# Move to the project root.
cd "$(dirname "$0")/../.."

# Start logging, if requested. Not using multilog here right now
# because there are race issues when restarting.
[ -z "${logdir:-}" ] || exec &>> "${logdir}/current"

# Prevent reloading if this is running under supervise(8).
if [ "/proc/${PPID}/exe" -ef "/usr/bin/supervise" ]
then
    set -- "$@" --noreload
fi

# DNS settings, for driving BIND.
export MAAS_DNS_CONFIG_DIR="$(cd run/named && pwd)"
export MAAS_DNS_RNDC_PORT=5247
export MAAS_DNS_DEFAULT_CONTROLS=0

# Exec the MAAS API and Web UI Server.
script="$(readlink -f bin/maas-region-admin)"
exec "${script}" runserver 5243 --settings=maas.demo "$@"