I can't run DHCP service



  • Hi
    I have pfSense 2.1 Release  (amd64)
    I have default configuration. Why I can't run DHCP service. In Menu Status -> Services.  I have status STOPPED if I will click start service. Service still is STOPPED.

    My configs:


  • Rebel Alliance Global Moderator

    And what errors do you get in the log for it trying to start?



  • This is my partial log


  • Rebel Alliance Global Moderator

    well that says dhcpd is already running.

    What do you get from say the following command

    [2.1-RELEASE][root@pfsense.local.lan]/root(4): ps ax | grep dhcpd
    19695  ??  Ss    0:00.92 /usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot /var/dhcpd -cf /etc/dhcpd.conf -pf /var/run/dhcpd.pid em0 em2 em3
    94985  ??  INs    0:00.02 /usr/local/sbin/dhcpleases -l /var/dhcpd/var/db/dhcpd.leases -d local.lan -p /var/run/dnsmasq.pid -h /var/etc/hosts
    95845  ??  Ss    0:31.58 /usr/sbin/syslogd -s -c -c -l /var/dhcpd/var/run/log -f /var/etc/syslog.conf

    I see you have opt1 interface there - do you have overlapping networks on them or something?

    Do you show a pid for dhcpd? look in /var/dhcpd/var/run

    [2.1-RELEASE][root@pfsense.local.lan]/var/dhcpd/var/run(11): ls -la
    total 6
    drwxr-xr-x  2 dhcpd  _dhcp  512 Nov  5 14:40 .
    drwxr-xr-x  4 dhcpd  _dhcp  512 Mar 22  2012 ..
    -rw-r–r--  1 dhcpd  _dhcp    6 Nov  4 16:23 dhcpd.pid
    srw-rw-rw-  1 dhcpd  _dhcp    0 Oct 18 13:49 log

    If you see an old pid - remove it with the rm command.



  • ps ax | grep dhcp
    40369  ??  Is    0:00.00 /usr/sbin/syslogd -s -c -c -l /var/dhcpd/var/run/log -f /var/etc/syslog.conf

    in /var/dhcpd/var/run
    total 6
    drwxr-xr-x  2 dhcpd  _dhcp  512 Nov  5 21:47 .
    drwxr-xr-x  4 dhcpd  _dhcp  512 Oct 31 23:30 ..
    -rw-r–r--  1 dhcpd  _dhcp    6 Nov  1 00:05 dhcpd.pid
    srw-rw-rw-  1 root  _dhcp    0 Nov  5 21:47 log

    I don't have overlapping networks in opt1


  • Rebel Alliance Global Moderator

    that id not the command I ran, its dhcpd not just dhcp

    And you have a pid there, so you might want to try and remove it.



  • I ran this command : ps ax | grep dhcpd
    My result.

    39047  ??  Is    0:00.00 /usr/sbin/syslogd -s -c -c -l /var/dhcpd/var/run/log


  • Rebel Alliance Global Moderator

    Again you show a PID, did you delete that PID file?

    in /var/dhcpd/var/run
    total 6
    drwxr-xr-x  2 dhcpd  _dhcp  512 Nov  5 21:47 .
    drwxr-xr-x  4 dhcpd  _dhcp  512 Oct 31 23:30 ..
    -rw-r–r--  1 dhcpd  _dhcp    6 Nov  1 00:05 dhcpd.pid
    srw-rw-rw-  1 root  _dhcp    0 Nov  5 21:47 log



  • Hi
    After deleting this PID file , everything works properly. Thank you for help me. But I have one question why I had to delete this file ?.


  • Rebel Alliance Global Moderator

    because something got stuck and system thought it was running because of the pid file, when it really wasnt.  Did you have a power outage or something?

    So you cleared up the old pid, now if you look there is a new pid file - if you view the contents of the file with cat it will show you a number – the pid..  As you stop and start the service this number will change.

    If something wrong with the file, or it has a pid number of a running process that is not dhcpd - system can think dhcpd is already running, etc.

    deleting it just allowed whatever the snafu was to get cleared up.