1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
| [iyunv@localhost ~]# service dhcpd restart
正在启动 dhcpd: [确定]
[iyunv@localhost ~]# /etc/init.d/dhcpd status
dhcpd 已死,但 pid 文件仍存
[iyunv@localhost ~]# tail -f /var/log/messages
Feb 3 02:12:49 localhost dhcpd: This version of ISC DHCP is based on the release available
Feb 3 02:12:49 localhost dhcpd: on ftp.isc.org. Features have been added and other changes
Feb 3 02:12:49 localhost dhcpd: have been made to the base software release in order to make
Feb 3 02:12:49 localhost dhcpd: it work better with this distribution.
Feb 3 02:12:49 localhost dhcpd:
Feb 3 02:12:49 localhost dhcpd: Please report for this software via the CentOS Bugs Database:
Feb 3 02:12:49 localhost dhcpd: http://bugs.centos.org/
Feb 3 02:12:49 localhost dhcpd:
Feb 3 02:12:49 localhost dhcpd: exiting.
Feb 3 02:12:49 localhost kernel: type=1400 audit(1422900769.294:87): avc: denied { setgid } for pid=4606 comm="dhcpd" capability=6 scontext=unconfined_u:system_r:dhcpd_t:s0 tcontext=unconfined_u:system_r:dhcpd_t:s0 tclass=capability
大概的意思就是启动dhcp连接读取系统文件被denied,就查找相关权限;
[iyunv@localhost ~]# /usr/sbin/dhcpd restart
Internet Systems Consortium DHCP Server 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Wrote 0 class decls to leases file.
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 0 leases to leases file.
No subnet declaration for restart (no IPv4 addresses).
** Ignoring requests on restart. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface restart is attached. **
Not configured to listen on any interfaces!
This version of ISC DHCP is based on the release available
on ftp.isc.org. Features have been added and other changes
have been made to the base software release in order to make
it work better with this distribution.
Please report for this software via the CentOS Bugs Database:
http://bugs.centos.org/
exiting.
[iyunv@localhost ~]# ls -l /etc/dhcp/dhcpd.conf
-rw-r--r--. 1 root root 3626 2月 3 02:17 /etc/dhcp/dhcpd.conf #显示root用户
[iyunv@localhost ~]# vi /etc/init.d/dhcpd
prog=dhcpd #
user=root #原先是dhcpd 改为root
group=root # #原先是dhcpd 改为root
exec=/usr/sbin/dhcpd
lockfile=/var/lock/subsys/dhcpd
pidfile=/var/run/dhcpd.pid
statedir=/var/lib/dhcpd
改完重试一下!
[iyunv@localhost ~]# service dhcpd restart
关闭 dhcpd: [确定]
正在启动 dhcpd: [确定]
[iyunv@localhost ~]# ps -ax | grep dhcpd
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
4992 ? Ss 0:00 /usr/sbin/dhcpd -user root -group root
4996 pts/1 S+ 0:00 grep dhcpd
|