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

How to restart dhcpd?

Scheduled Pinned Locked Moved DHCP and DNS
4 Posts 4 Posters 8.5k Views
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.
  • G
    gwa
    last edited by Dec 29, 2009, 4:54 PM

    Running a Captive Portal for a library. They want access turned off after hours. If I use cron to set LAN interface to down, sometimes the DHCP server stops. I can issue the start command via cron:

    /usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot /var/dhcpd -cf /var/dhcpd/etc/dhcpd.conf vr0

    but sometimes dhcpd is already running. Is there a restart option or script?

    Thanks

    1 Reply Last reply Reply Quote 0
    • P
      pmvalente
      last edited by Feb 11, 2010, 2:58 PM

      I'm not the most qualify person to sugest this, but why don't you invoke stop dhcpd first and then start it?

      1 Reply Last reply Reply Quote 0
      • J
        jahonix
        last edited by Feb 15, 2010, 9:49 AM

        Just use a different approach!

        At  Firewall | Schedules  create surftimes or off-times and apply them to allow or deny rules.
        This way traffic gets blocked by a rule and not because an IF is down. Solves your problems with the DHCP server instantly.

        1 Reply Last reply Reply Quote 0
        • J
          jimp Rebel Alliance Developer Netgate
          last edited by Feb 15, 2010, 5:07 PM

          The scheduled rules approach should work.

          That said, if you want to continue using your cron method your best option is to killall -9 dhcpd before restarting it, that way it won't ever be running when you run it from cron.

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
            This community forum collects and processes your personal information.
            consent.not_received