Merge lp:~smoser/maas/packaging.lp1049177 into lp:~maas-maintainers/maas/packaging

Proposed by Scott Moser
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 81
Merged at revision: 81
Proposed branch: lp:~smoser/maas/packaging.lp1049177
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 53 lines (+20/-5)
4 files modified
debian/changelog (+7/-5)
debian/maas-dhcp.apparmor (+7/-0)
debian/maas-dhcp.install (+1/-0)
debian/rules (+5/-0)
To merge this branch: bzr merge lp:~smoser/maas/packaging.lp1049177
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve
Review via email: mp+124083@code.launchpad.net

Commit message

Add a maas specific profile for isc-dhcp-server package.

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

In work done to the isc-dhcp package under bug 1049177 I modified the apparmor profile to have '#include <dhcpd.d>', allowing packages to install extensions to the base profile into package specific files in /etc/apparmor.d/dhcpd.d .

This packaging change adds a file there that should allow maas to run a dhcpd with a command line similar to:
  dhcpd -d -user dhcpd -group dhcpd -f -4 \
   -pf /run/maas/dhcp/dhcpd.pid -cf /etc/maas/dhcpd.conf \
   -lf /run/maas/dhcp/dhcpd.leases

I've tested that the given profile allows running of the above, but it is a bit tricky to get right. I've put a script that creates correct permissions at [1]. That is largely modelled after the upstart job in /etc/init/isc-dhcpd-server .

Note also that still to be done here is to install the upstart job. There is probably some packaging changes needed to get the upstart job into the maas-dhcp package. I believe that Jeroen's intent was to have trunk install /etc/init/maas-dhcp.conf but we'll need to pick that file into the maas-dhcp package still.

--
[1] http://paste.ubuntu.com/1201622/

Revision history for this message
Julian Edwards (julian-edwards) wrote :

We need a similar fix in the packaging.precise packaging branch too, otherwise this looks good.

review: Approve
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Is the leases file a typo? It should be in /var/lib of course, not in /run.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Ah yes I see it is just a typo. No worries.

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 2012-09-05 16:40:29 +0000
3+++ debian/changelog 2012-09-13 00:23:19 +0000
4@@ -1,8 +1,10 @@
5-maas (0.1+bzr971+dfsg-0ubuntu3) UNRELEASED; urgency=low
6-
7- * UNRELEASED
8-
9- -- Andres Rodriguez <andreserl@ubuntu.com> Wed, 05 Sep 2012 12:40:20 -0400
10+maas (0.1+bzr971+dfsg-0ubuntu4) UNRELEASED; urgency=low
11+
12+ [ Scott Moser ]
13+ * debian/maas-dhcp.{install,apparmor} install apparmor profile into
14+ /etc/apparmor.d/dhcpd.d (LP: #1049177)
15+
16+ -- Scott Moser <smoser@ubuntu.com> Wed, 12 Sep 2012 20:10:13 -0400
17
18 maas (0.1+bzr971+dfsg-0ubuntu2) quantal; urgency=low
19
20
21=== added file 'debian/maas-dhcp.apparmor'
22--- debian/maas-dhcp.apparmor 1970-01-01 00:00:00 +0000
23+++ debian/maas-dhcp.apparmor 2012-09-13 00:23:19 +0000
24@@ -0,0 +1,7 @@
25+/run/maas/dhcp/ r,
26+/run/maas/dhcp/** r,
27+/run/maas/dhcp/*.pid lrw,
28+/run/maas/dhcp/*.trace lrw,
29+/run/maas/dhcp/*.leases* lrw,
30+/var/lib/maas/dhcpd/*.leases* lrw,
31+/etc/maas/dhcpd.conf r,
32
33=== added file 'debian/maas-dhcp.install'
34--- debian/maas-dhcp.install 1970-01-01 00:00:00 +0000
35+++ debian/maas-dhcp.install 2012-09-13 00:23:19 +0000
36@@ -0,0 +1,1 @@
37+/debian/tmp/etc/apparmor.d/dhcpd.d/maas
38
39=== modified file 'debian/rules'
40--- debian/rules 2012-08-29 02:56:47 +0000
41+++ debian/rules 2012-09-13 00:23:19 +0000
42@@ -32,6 +32,11 @@
43 # Install built enums.js file.
44 cp $(BUILDHOME)/enums.js $(CURDIR)/debian/tmp/usr/share/maas/web/static/js/
45
46+ # install the apparmor profile
47+ install -d -m 755 $(CURDIR)/debian/tmp/etc/apparmor.d/dhcpd.d
48+ install -m 644 $(CURDIR)/debian/maas-dhcp.apparmor \
49+ $(CURDIR)/debian/tmp/etc/apparmor.d/dhcpd.d/maas
50+
51 dh_install --list-missing
52
53 override_dh_auto_clean:

Subscribers

People subscribed via source and target branches