Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    I can't run DHCP service

    DHCP and DNS
    2
    10
    4.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      matrix5000
      last edited by

      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:

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator
        last edited by

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

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.7.2, 24.11

        1 Reply Last reply Reply Quote 0
        • M
          matrix5000
          last edited by

          This is my partial log

          1 Reply Last reply Reply Quote 0
          • johnpozJ
            johnpoz LAYER 8 Global Moderator
            last edited by

            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.

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.7.2, 24.11

            1 Reply Last reply Reply Quote 0
            • M
              matrix5000
              last edited by

              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

              1 Reply Last reply Reply Quote 0
              • johnpozJ
                johnpoz LAYER 8 Global Moderator
                last edited by

                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.

                An intelligent man is sometimes forced to be drunk to spend time with his fools
                If you get confused: Listen to the Music Play
                Please don't Chat/PM me for help, unless mod related
                SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                1 Reply Last reply Reply Quote 0
                • M
                  matrix5000
                  last edited by

                  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

                  1 Reply Last reply Reply Quote 0
                  • johnpozJ
                    johnpoz LAYER 8 Global Moderator
                    last edited by

                    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

                    An intelligent man is sometimes forced to be drunk to spend time with his fools
                    If you get confused: Listen to the Music Play
                    Please don't Chat/PM me for help, unless mod related
                    SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                    1 Reply Last reply Reply Quote 0
                    • M
                      matrix5000
                      last edited by

                      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 ?.

                      1 Reply Last reply Reply Quote 0
                      • johnpozJ
                        johnpoz LAYER 8 Global Moderator
                        last edited by

                        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.

                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                        If you get confused: Listen to the Music Play
                        Please don't Chat/PM me for help, unless mod related
                        SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.