Originally Posted by brother.gabriel
I didn't make up the part about selinux blocking the dhcp (I can't remember where someone said that would solve it) - I don't doubt you are right, sag47, but disabling it did in fact, work. If it were a configuration error then the service wouldn't start. But now I can start and restart as I like (which is how it worked before when I had selinux disabled in the first place).
I didn't say you made up SELinux interfering with it. It is likely interfering by design because you have it misconfigured.
My dhcp works just fine with SELinux enabled.
[root@stealth lib]# ls -Z /var/lib | grep dhcpd
drwxr-xr-x. dhcpd dhcpd system_u:object_r:dhcpd_state_t:s0 dhcpd
[root@stealth dhcp]# ls -Z /etc/dhcp/
drwxr-xr-x. root root system_u:object_r:bin_t:s0 dhclient.d
-rw-r--r--. root root system_u:object_r:dhcp_etc_t:s0 dhcpd6.conf
-rw-r--r--. root root system_u:object_r:dhcp_etc_t:s0 dhcpd.conf
[root@stealth dhcp]# getenforce
[root@stealth dhcp]# systemctl status dhcpd.service
dhcpd.service - DHCPv4 Server Daemon
Loaded: loaded (/lib/systemd/system/dhcpd.service; enabled)
Active: active (running) since Tue, 16 Oct 2012 00:12:30 -0400; 2 weeks and 1 days ago
Main PID: 29061 (dhcpd)
└ 29061 /usr/sbin/dhcpd -f -user dhcpd -group dhcpd --no-pid
In all likelihood you just have your security contexts incorrect. Notice I have dhcpd running with no problems along side SELinux.
I would also like you to note the security context type on /etc/dhcp/dhcpd.conf (the type is dhcp_etc_t) and /var/lib/dhcpd/ folder (the type is dhcpd_state_t). The contents of /var/lib/dhcpd/ should also be of type dhcpd_state_t.
If it's not then see the man page for restorecon
command (namely the -R option) search my LQ blog
entries for selinux where I encounter problems and resolve them. By disabling SELinux you're removing a primary feature that makes having CentOS or RHEL worth having over other operating systems.