2
Description=MAAS Region Controller
2
Description=MAAS Region Controller (Worker %i)
3
Documentation=https://maas.ubuntu.com/
3
4
Requires=network-online.target
4
5
After=network-online.target
6
Requires=postgresql.service
7
After=postgresql.service
8
PartOf=maas-regiond.service
5
9
# This will go away one we support new config files.
6
10
ConditionPathExists=/etc/maas/maas_local_settings.py
10
16
Environment="DJANGO_SETTINGS_MODULE=maas.settings"
11
Environment="PYTHONPATH=/usr/share/maas"
12
ExecStart=/bin/sh -ec '\
13
if [ -d "/usr/lib/django16" ]; then DJANGO_SETTINGS_MODULE=maas.settings; \
14
PYTHONPATH="/usr/share/maas:/usr/lib/django16"; fi; \
15
exec /usr/bin/authbind --deep /usr/bin/twistd \
16
--nodaemon --pidfile= maas-regiond > /var/log/maas/regiond.log 2>&1'
17
Environment="PYTHONPATH=/usr/share/maas:/usr/lib/django16"
18
Environment="LOGFILE=/var/log/maas/regiond.log"
19
# Logs go to the journal; read them with:
20
# journalctl -u maas-regiond-worker@*
21
# Logs also go to $LOGFILE for backward compatibility. The journal
22
# should now be preferred as $LOGFILE will be removed in MAAS 1.9.
23
ExecStart=/bin/sh -c \
24
'exec twistd --nodaemon --pidfile= maas-regiond 2>&1 | tee -a $LOGFILE'
19
WantedBy=multi-user.target
27
WantedBy=maas-regiond.service