Ticket #1898 (closed defect: fixed)
apparmor prevents dynamic dns with dhcp
| Reported by: | p.elsie | Owned by: | ejhernandez@… |
|---|---|---|---|
| Milestone: | 2.0.X | Component: | base |
| Severity: | critical | Keywords: | |
| Cc: | gilles.ebox@… |
Description
If you enable the "Dynamic DNS Options" on DHCP then then dhcp server will not start. If you run the command "sudo /etc/init.d/dhcp3-server restart" then you'll see some output like:
Can't open /etc/bind/keys: Permission denied
If you then run dmesg you'll get some apparmor details.
The workaround is to add the following to /etc/apparmor.d/usr.sbin.dhcpd3
# Ebox /etc/bind/keys r,
Then you must restart apparmor:
sudo /etc/init.d/apparmor restart
This occurs in Lucid with 1.5.
Attachments
Change History
comment:3 Changed 3 years ago by adrian@…
- priority changed from normal to high
- Severity changed from major to critical
Same thing just happened to me. Funny story too, my family is leaving for france _NOW_ and had to access the internet, of course that was not possible without the dhcp server giving the laptop an ip address, so they had to wake me, I'm going to work in 3 hours and have had 2 hours of sleep... basically what I'm saying is, implement the suggested fix ASAP because it works and I'd hate to see anyone else end up in the same situation as me.
comment:4 Changed 3 years ago by gilles.ebox@…
- Cc gilles.ebox@… added
FYI, the changes indicated so far are valid as they are necessary to get at least some DNS working. However, my clients were still failing to get local static and dynamic DHCP assignment into the DNS.
Looking at the log I could see I was getting Apparmor error on bind:
[2053937.926743] type=1503 audit(1279377850.479:229): operation="mknod" pid=2386 parent=1 profile="/usr/sbin/named" requested_mask="c::" denied_mask="c::" fsuid=108 ouid=108 name="/etc/bind/db.home.mynet.org.jnl"
Looks like bind has been wrongly configured in the ebox context and put dynamic updates in /etc/bind instead of /var/lib/bind
Now I don't know where to change that (without perhaps affecting ebox as a whole).
So for the moment I have changed the named profileto allow "/etc/bind" to be rw (instead of "r") although this is not ideal (just don't forget to restart apparmor after the change).
comment:5 Changed 3 years ago by fjbejarano@…
Hi,
I have the same problem with Zentyal 2.0.1 amd64. I have resolved the proble with the solution of this ticket but I think that this problem needs an automated solution.
Regards
comment:11 Changed 3 years ago by ejhernandez@…
- Status changed from new to closed
- Resolution set to fixed
I had exactly the same problem and the proposed solution works fine.
I would only add that the # Ebox needs to be on a line of its own and the remaining part, (i.e. /etc/bind/keys r,) needs to be on the following line and all of this needs to be before the last closing brace at the end of the file.