Merge lp:~andreserl/maas/maas_systemd_1.8 into lp:~maas-maintainers/maas/packaging

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 368
Merged at revision: 363
Proposed branch: lp:~andreserl/maas/maas_systemd_1.8
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 190 lines (+116/-2)
9 files modified
debian/changelog (+1/-1)
debian/control (+1/-0)
debian/maas-cluster-controller.maas-clusterd.service (+21/-0)
debian/maas-cluster-controller.postinst (+1/-0)
debian/maas-dhcp.maas-dhcpd.service (+23/-0)
debian/maas-dhcp.maas-dhcpd6.service (+23/-0)
debian/maas-proxy.maas-proxy.service (+13/-0)
debian/maas-region-controller-min.maas-regiond.service (+17/-0)
debian/rules (+16/-1)
To merge this branch: bzr merge lp:~andreserl/maas/maas_systemd_1.8
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Martin Pitt (community) Approve
Review via email: mp+252515@code.launchpad.net

Commit message

Add systemd support for MAAS controlled daemons.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

I have a similar question/suggestion as in https://code.launchpad.net/~andreserl/maas/maas_systemd_1.7/+merge/252511 but in general this LGTM. Thanks!

review: Approve
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Comments inline!

Revision history for this message
Andres Rodriguez (andreserl) :
review: Approve
Revision history for this message
Gavin Panella (allenap) wrote :

Wow, configuring systemd looks awful. It's built like no one cares. I don't care a lot about upstart versus systemd, but on configuration, systemd really loses. I'm going to see if there are some m4 macros in systemd to make this *better*. Can we run upstart via systemd perhaps?

Revision history for this message
Andres Rodriguez (andreserl) wrote :

In vivid+ we would have to run systemd. On earlier releases upstart will continue to be used.

Revision history for this message
Gavin Panella (allenap) wrote :

> In vivid+ we would have to run systemd. On earlier releases upstart
> will continue to be used.

Oh yeah, I know, and I don't mind. I was wondering, only half-joking, if
upstart could be run as a service by systemd, like any other service.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-03-10 20:37:04 +0000
3+++ debian/changelog 2015-03-17 20:12:44 +0000
4@@ -1,4 +1,4 @@
5-maas (1.8.0~alpha6+bzr3629-0ubuntu1) UNRELEASED; urgency=medium
6+maas (1.8.0~alpha6+bzr3661-0ubuntu1) UNRELEASED; urgency=medium
7
8 * UNRELEASED
9
10
11=== modified file 'debian/control'
12--- debian/control 2015-03-06 23:10:41 +0000
13+++ debian/control 2015-03-17 20:12:44 +0000
14@@ -4,6 +4,7 @@
15 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
16 Build-Depends: debhelper (>= 8.1.0~),
17 dh-apport,
18+ dh-systemd,
19 po-debconf,
20 python (>= 2.7),
21 python-distribute,
22
23=== added file 'debian/maas-cluster-controller.maas-clusterd.service'
24--- debian/maas-cluster-controller.maas-clusterd.service 1970-01-01 00:00:00 +0000
25+++ debian/maas-cluster-controller.maas-clusterd.service 2015-03-17 20:12:44 +0000
26@@ -0,0 +1,21 @@
27+[Unit]
28+Description=MAAS Cluster Controller
29+Requires=network-online.target
30+After=network-online.target
31+ConditionPathExists=/etc/maas/maas_cluster.conf
32+# This (pserv.yaml) will go away once streamline
33+# config files or move to sqlite.
34+ConditionPathExists=/etc/maas/pserv.yaml
35+ConditionPathExists=/var/lib/maas/secret
36+
37+[Service]
38+Restart=on-failure
39+EnvironmentFile=/etc/maas/maas_cluster.conf
40+ExecStart=/bin/sh -ec '\
41+ exec /usr/bin/authbind --deep /usr/bin/twistd \
42+ --nodaemon --uid=maas --gid=maas --pidfile=/run/maas-cluster.pid \
43+ maas-clusterd --config-file=/etc/maas/pserv.yaml > \
44+ /var/log/maas/clusterd.log 2>&1'
45+
46+[Install]
47+WantedBy=multi-user.target
48
49=== modified file 'debian/maas-cluster-controller.postinst'
50--- debian/maas-cluster-controller.postinst 2015-02-17 15:43:32 +0000
51+++ debian/maas-cluster-controller.postinst 2015-03-17 20:12:44 +0000
52@@ -14,6 +14,7 @@
53 fi
54 # Main syslog file.
55 if [ ! -f /var/log/maas/maas.log ]; then
56+ mkdir -p /var/log/maas
57 touch /var/log/maas/maas.log
58 fi
59
60
61=== added file 'debian/maas-dhcp.maas-dhcpd.service'
62--- debian/maas-dhcp.maas-dhcpd.service 1970-01-01 00:00:00 +0000
63+++ debian/maas-dhcp.maas-dhcpd.service 2015-03-17 20:12:44 +0000
64@@ -0,0 +1,23 @@
65+[Unit]
66+Description=MAAS instance of ISC DHCP server for IPv4
67+Documentation=man:dhcpd(8)
68+Wants=network-online.target
69+After=network-online.target
70+After=time-sync.target
71+ConditionPathExists=/etc/maas/dhcpd.conf
72+ConditionPathExists=/var/lib/maas/dhcpd-interfaces
73+
74+[Service]
75+ExecStartPre=/bin/mkdir -p /run/maas/dhcp
76+# Allow dhcp server to write lease and pid file as 'dhcpd' user
77+ExecStartPre=/bin/chown dhcpd:dhcpd /run/maas/dhcp
78+# The leases files need to be root:root even when dropping privileges
79+ExecStart=/bin/sh -ec '\
80+ CONFIG_FILE=/etc/maas/dhcpd.conf; \
81+ INTERFACES_FILE=/var/lib/maas/dhcpd-interfaces; \
82+ [ -e /var/lib/maas/dhcp/dhcpd.leases ] || touch /var/lib/maas/dhcp/dhcpd.leases; \
83+ chown root:root /var/lib/maas/dhcp /var/lib/maas/dhcp/dhcpd.leases*; \
84+ exec dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/maas/dhcp/dhcpd.pid -cf $CONFIG_FILE $INTERFACES_FILE'
85+
86+[Install]
87+WantedBy=multi-user.target
88
89=== added file 'debian/maas-dhcp.maas-dhcpd6.service'
90--- debian/maas-dhcp.maas-dhcpd6.service 1970-01-01 00:00:00 +0000
91+++ debian/maas-dhcp.maas-dhcpd6.service 2015-03-17 20:12:44 +0000
92@@ -0,0 +1,23 @@
93+[Unit]
94+Description=MAAS instance of ISC DHCP server for IPv6
95+Documentation=man:dhcpd(8)
96+Wants=network-online.target
97+After=network-online.target
98+After=time-sync.target
99+ConditionPathExists=/etc/maas/dhcpd6.conf
100+ConditionPathExists=/var/lib/maas/dhcpd-interfaces
101+
102+[Service]
103+ExecStartPre=/bin/mkdir -p /run/maas/dhcp
104+# Allow dhcp server to write lease and pid file as 'dhcpd' user
105+ExecStartPre=/bin/chown dhcpd:dhcpd /run/maas/dhcp
106+# The leases files need to be root:root even when dropping privileges
107+ExecStart=/bin/sh -ec '\
108+ CONFIG_FILE=/etc/maas/dhcpd6.conf; \
109+ INTERFACES_FILE=/var/lib/maas/dhcpd-interfaces; \
110+ [ -e /var/lib/maas/dhcp/dhcpd6.leases ] || touch /var/lib/maas/dhcp/dhcpd6.leases; \
111+ chown root:root /var/lib/maas/dhcp /var/lib/maas/dhcp/dhcpd6.leases*; \
112+ exec dhcpd -user dhcpd -group dhcpd -f -6 -pf /run/maas/dhcp/dhcpd6.pid -cf $CONFIG_FILE $INTERFACES_FILE'
113+
114+[Install]
115+WantedBy=multi-user.target
116
117=== added file 'debian/maas-proxy.maas-proxy.service'
118--- debian/maas-proxy.maas-proxy.service 1970-01-01 00:00:00 +0000
119+++ debian/maas-proxy.maas-proxy.service 2015-03-17 20:12:44 +0000
120@@ -0,0 +1,13 @@
121+[Unit]
122+Description=MAAS Proxy
123+Requires=network-online.target
124+After=network-online.target
125+ConditionPathExists=/etc/maas/maas-proxy.conf
126+
127+[Service]
128+ExecStartPre=/bin/mkdir -p /run/maas/proxy
129+ExecStartPre=/bin/sh /usr/share/maas/maas-proxy-common.sh
130+ExecStart=/usr/bin/squid -N -f /etc/maas/maas-proxy.conf
131+
132+[Install]
133+WantedBy=multi-user.target
134
135=== added file 'debian/maas-region-controller-min.maas-regiond.service'
136--- debian/maas-region-controller-min.maas-regiond.service 1970-01-01 00:00:00 +0000
137+++ debian/maas-region-controller-min.maas-regiond.service 2015-03-17 20:12:44 +0000
138@@ -0,0 +1,17 @@
139+[Unit]
140+Description=MAAS Region Controller
141+Requires=network-online.target
142+After=network-online.target
143+# This will go away one we support new config files.
144+ConditionPathExists=/etc/maas/maas_local_settings.py
145+
146+[Service]
147+Restart=on-failure
148+Environment="DJANGO_SETTINGS_MODULE=maas.settings"
149+Environment="PYTHONPATH=/usr/share/maas"
150+ExecStart=/bin/sh -ec '\
151+ exec /usr/bin/authbind --deep /usr/bin/twistd \
152+ --nodaemon --pidfile= maas-regiond > /var/log/maas/regiond.log 2>&1'
153+
154+[Install]
155+WantedBy=multi-user.target
156
157=== modified file 'debian/rules'
158--- debian/rules 2015-03-02 20:15:22 +0000
159+++ debian/rules 2015-03-17 20:12:44 +0000
160@@ -6,14 +6,29 @@
161 py_enums := $(wildcard src/*/enum.py)
162
163 %:
164- dh $@ --with python2,apport --buildsystem=python_distutils
165+ dh $@ --with python2,apport,systemd --buildsystem=python_distutils
166
167 override_dh_installinit:
168+ # maas-clusterd
169+ dh_systemd_enable --name maas-clusterd
170 dh_installinit --name maas-clusterd
171+ dh_systemd_start --name maas-clusterd
172+ # maas-regiond
173+ dh_systemd_enable --name maas-regiond
174 dh_installinit --name maas-regiond
175+ dh_systemd_start --name maas-regiond
176+ # maas-dhcpd
177+ dh_systemd_enable --name maas-dhcpd
178 dh_installinit --name maas-dhcpd
179+ dh_systemd_start --name maas-dhcpd
180+ # maas-dhcpd6
181+ dh_systemd_enable --name maas-dhcpd6
182 dh_installinit --name maas-dhcpd6
183+ dh_systemd_start --name maas-dhcpd6
184+ # maas-proxy
185+ dh_systemd_enable --name maas-proxy
186 dh_installinit --name maas-proxy
187+ dh_systemd_start --name maas-proxy
188
189 override_dh_auto_build:
190 dh_auto_build

Subscribers

People subscribed via source and target branches

to all changes: