系统环境:


[root@cobbler cobbler]# cat /etc/redhat-release 

CentOS release 6.4 (Final)

[root@cobbler cobbler]# uname -a

Linux cobbler 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux


软件版本:

dhcp-4.1.1-43.P1.el6.centos.1.x86_64.rpm  



[root@fuck ~]# /usr/sbin/dhcpd start

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 leases to leases file.

No subnet declaration for start (no IPv4 addresses).

** Ignoring requests on start.  If this is not what

   you want, please write a subnet declaration

   in your dhcpd.conf file for the network segment

   to which interface start 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.

[root@fuck ~]# /etc/init.d/dhcpd start

Starting dhcpd:                                            [FAILED]



个人解决:

[root@cobbler ~]# netstat  -lntup

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   

tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1250/sshd           

tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1328/master         

tcp        0      0 :::22                       :::*                        LISTEN      1250/sshd           

tcp        0      0 ::1:25                      :::*                        LISTEN      1328/master         

udp        0      0 0.0.0.0:68                  0.0.0.0:*                               1786/dhclient       

[root@cobbler ~]# lsof -i udp:68

COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME

dhclient 1786 root    6u  IPv4  14099      0t0  UDP *:bootpc 

[root@cobbler ~]# ps -ef|grep dhcli

root      1786     1  0 17:07 ?        00:00:00 /sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0

root      1957  1929  0 17:12 pts/1    00:00:00 grep dhcli

[root@cobbler ~]# kill -TERM `cat /var/run/dhclient-eth0.pid`

[root@cobbler ~]# kill -TERM `cat /var/run/dhclient-eth0.pid`

-bash: kill: (1786) - No such process

[root@cobbler ~]# vim /etc/rc.local 


发现这里多了一个dhclient,所以我就杀掉进程,并不让他启动。


[root@cobbler ~]# cobbler check

The following are potential configuration items that you may want to fix:


1 : since iptables may be running, ensure 69, 80/443, and 25151 are unblocked


Restart cobblerd and then run 'cobbler sync' to apply changes.


[root@cobbler ~]# cobbler sync

task started: 2015-03-27_184419_sync

task started (id=Sync, time=Fri Mar 27 18:44:19 2015)

running pre-sync triggers

cleaning trees

removing: /var/lib/tftpboot/pxelinux.cfg/default

removing: /var/lib/tftpboot/grub/p_w_picpaths

removing: /var/lib/tftpboot/grub/grub-x86.efi

removing: /var/lib/tftpboot/grub/efidefault

removing: /var/lib/tftpboot/grub/grub-x86_64.efi

removing: /var/lib/tftpboot/s390x/profile_list

copying bootloaders

trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi

trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi

copying distros to tftpboot

copying p_w_picpaths

generating PXE configuration files

generating PXE menu structure

rendering DHCP files

generating /etc/dhcp/dhcpd.conf

rendering TFTPD files

generating /etc/xinetd.d/tftp

cleaning link caches

rendering Rsync files

running post-sync triggers

running python triggers from /var/lib/cobbler/triggers/sync/post/*

running python trigger cobbler.modules.sync_post_restart_services

running: dhcpd -t -q

received on stdout: 

received on stderr: 

running: service dhcpd restart

received on stdout: Shutting down dhcpd: [  OK  ]

Starting dhcpd: [  OK  ]


received on stderr: 

running shell triggers from /var/lib/cobbler/triggers/sync/post/*

running python triggers from /var/lib/cobbler/triggers/change/*

running python trigger cobbler.modules.scm_track

running shell triggers from /var/lib/cobbler/triggers/change/*

*** TASK COMPLETE ***



[root@cobbler ~]# /etc/init.d/dhcpd status

dhcpd (pid  28881) is running...

[root@cobbler ~]# ps -ef|grep dhcp

dhcpd    28881     1  0 18:44 ?        00:00:00 /usr/sbin/dhcpd -user dhcpd -group dhcpd

root     28888  1523  0 18:45 pts/0    00:00:00 grep dhcp

[root@cobbler ~]# netstat -lntup|grep dhcp

udp        0      0 0.0.0.0:67                  0.0.0.0:*                               28881/dhcpd         

[root@cobbler ~]# lsof -i :67

COMMAND   PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME

dhcpd   28881 dhcpd    7u  IPv4  32708      0t0  UDP *:bootps