~andreserl/maas/1.8b8

« back to all changes in this revision

Viewing changes to debian/maas-region-controller-min.maas-regiond-worker@.service

[r=andreserl,mpontillo,ubuntudotcom1][bug=1452276][author=allenap] Launch 4 maas-regiond workers using systemd template units.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
[Unit]
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
7
11
 
8
12
[Service]
9
 
Restart=on-failure
 
13
User=maas
 
14
Group=maas
 
15
Restart=always
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'
17
25
 
18
26
[Install]
19
 
WantedBy=multi-user.target
 
27
WantedBy=maas-regiond.service