Merge lp:~andreserl/maas/fix_sytemd_units_dhcpd into lp:~maas-maintainers/maas/packaging

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 373
Merged at revision: 371
Proposed branch: lp:~andreserl/maas/fix_sytemd_units_dhcpd
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 76 lines (+24/-12)
3 files modified
debian/changelog (+4/-0)
debian/maas-dhcp.maas-dhcpd.service (+10/-6)
debian/maas-dhcp.maas-dhcpd6.service (+10/-6)
To merge this branch: bzr merge lp:~andreserl/maas/fix_sytemd_units_dhcpd
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Review via email: mp+254897@code.launchpad.net

Commit message

Fix systemd DHCPd units to correctly run in Vivid.

To post a comment you must log in.
372. By Andres Rodriguez

Fix typo

Revision history for this message
Raphaël Badin (rvb) :
373. By Andres Rodriguez

Fix comments

Revision history for this message
Raphaël Badin (rvb) :
review: Approve
Revision history for this message
Raphaël Badin (rvb) wrote :

Please double check that it works before landing… it's so easy to break things with these scripts…

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-30 23:23:34 +0000
3+++ debian/changelog 2015-04-01 11:41:38 +0000
4@@ -3,6 +3,10 @@
5 [ Mike Pontillo ]
6 * debian/extras/maas-region-admin: Fix Path setting.
7
8+ [ Andres Rodriguez ]
9+ * debian/maas-dhcp.maas-dhcpd[6].service: Fix units to correctly run
10+ in vivid.
11+
12 -- Andres Rodriguez <andreserl@ubuntu.com> Mon, 30 Mar 2015 19:17:47 -0400
13
14 maas (1.8.0~alpha9+bzr3750-0ubuntu1) trusty; urgency=medium
15
16=== modified file 'debian/maas-dhcp.maas-dhcpd.service'
17--- debian/maas-dhcp.maas-dhcpd.service 2015-03-10 20:56:06 +0000
18+++ debian/maas-dhcp.maas-dhcpd.service 2015-04-01 11:41:38 +0000
19@@ -8,16 +8,20 @@
20 ConditionPathExists=/var/lib/maas/dhcpd-interfaces
21
22 [Service]
23+# Allow dhcp server to write lease and pid file as 'dhcpd' user
24 ExecStartPre=/bin/mkdir -p /run/maas/dhcp
25-# Allow dhcp server to write lease and pid file as 'dhcpd' user
26-ExecStartPre=/bin/chown dhcpd:dhcpd /run/maas/dhcp
27+ExecStartPre=/bin/chown root:root /run/maas/dhcp
28 # The leases files need to be root:root even when dropping privileges
29+ExecStartPre=/bin/mkdir -p /var/lib/maas/dhcp
30+ExecStartPre=/bin/chown root:root /var/lib/maas/dhcp
31+# Start the daemon
32 ExecStart=/bin/sh -ec '\
33- CONFIG_FILE=/etc/maas/dhcpd.conf; \
34- INTERFACES_FILE=/var/lib/maas/dhcpd-interfaces; \
35- [ -e /var/lib/maas/dhcp/dhcpd.leases ] || touch /var/lib/maas/dhcp/dhcpd.leases; \
36+ INTERFACES=$(cat /var/lib/maas/dhcpd-interfaces); \
37+ LEASES_FILE=/var/lib/maas/dhcp/dhcpd.leases; \
38+ [ -e $LEASES_FILE ] || touch $LEASES_FILE; \
39 chown root:root /var/lib/maas/dhcp /var/lib/maas/dhcp/dhcpd.leases*; \
40- exec dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/maas/dhcp/dhcpd.pid -cf $CONFIG_FILE $INTERFACES_FILE'
41+ exec dhcpd -user dhcpd -group dhcpd -f -q -4 -pf /run/maas/dhcp/dhcpd.pid \
42+ -cf /etc/maas/dhcpd.conf -lf $LEASES_FILE $INTERFACES'
43
44 [Install]
45 WantedBy=multi-user.target
46
47=== modified file 'debian/maas-dhcp.maas-dhcpd6.service'
48--- debian/maas-dhcp.maas-dhcpd6.service 2015-03-10 20:56:06 +0000
49+++ debian/maas-dhcp.maas-dhcpd6.service 2015-04-01 11:41:38 +0000
50@@ -8,16 +8,20 @@
51 ConditionPathExists=/var/lib/maas/dhcpd-interfaces
52
53 [Service]
54+# Allow dhcp server to write lease and pid file as 'dhcpd' user
55 ExecStartPre=/bin/mkdir -p /run/maas/dhcp
56-# Allow dhcp server to write lease and pid file as 'dhcpd' user
57-ExecStartPre=/bin/chown dhcpd:dhcpd /run/maas/dhcp
58+ExecStartPre=/bin/chown root:root /run/maas/dhcp
59 # The leases files need to be root:root even when dropping privileges
60+ExecStartPre=/bin/mkdir -p /var/lib/maas/dhcp
61+ExecStartPre=/bin/chown root:root /var/lib/maas/dhcp
62+# Start the daemon
63 ExecStart=/bin/sh -ec '\
64- CONFIG_FILE=/etc/maas/dhcpd6.conf; \
65- INTERFACES_FILE=/var/lib/maas/dhcpd-interfaces; \
66- [ -e /var/lib/maas/dhcp/dhcpd6.leases ] || touch /var/lib/maas/dhcp/dhcpd6.leases; \
67+ INTERFACES=$(cat /var/lib/maas/dhcpd-interfaces); \
68+ LEASES_FILE=/var/lib/maas/dhcp/dhcpd6.leases; \
69+ [ -e $LEASES_FILE ] || touch $LEASES_FILE; \
70 chown root:root /var/lib/maas/dhcp /var/lib/maas/dhcp/dhcpd6.leases*; \
71- exec dhcpd -user dhcpd -group dhcpd -f -6 -pf /run/maas/dhcp/dhcpd6.pid -cf $CONFIG_FILE $INTERFACES_FILE'
72+ exec dhcpd -user dhcpd -group dhcpd -f -6 -pf /run/maas/dhcp/dhcpd6.pid \
73+ -cf /etc/maas/dhcpd6.conf -lf $LEASES_FILE $INTERFACES'
74
75 [Install]
76 WantedBy=multi-user.target

Subscribers

People subscribed via source and target branches

to all changes: