OpenBSD: Reload / Restart / Stop dhcpd Server Command

by on November 19, 2013 · 1 comment· LAST UPDATED November 19, 2013

in , , ,

I manage MS-Windows server and recently started to play with OpenBSD server. How do I reload or restart the dhcpd server on OpenBSD using shell command line option?

Tutorial details
DifficultyEasy (rss)
Root privilegesYes
Requirementsdhcpd
Estimated completion time1m
If you made changes to the configuration of your DHCP (dhcpd) server, you will have to stop and restart the server manually. On OpenBSD and Unix like operating system, you kill the dhcpd server and restart manually. Another option is to send HUP (SIGHUP) to dhcpd server.

Method#1: Find dhcpd PID and kill it

Type the following ps command to find dhcpd PID as root user:
# ps ax | grep dhcpd
Sample outputs:

USER       PID %CPU %MEM   VSZ   RSS TT   STAT STARTED       TIME COMMAND
_dhcp    13420  0.0  0.1   588   568 ??  Ss    10:27PM    0:00.04 dhcpd re0

You need to kill that process with kill command.
# kill -9 13420

To start dhcpd, type the following commands:
# touch /var/db/dhcpd.leases
# dhcpd -q re0

Method #2: Say hello to /etc/rc.d/dhcpd script

You can skip all of the above commands. Use rc script as follows to start, stop, restart, and check dhcpd server on OpenBSD:
/etc/rc.d/dhcpd start
/etc/rc.d/dhcpd stop
/etc/rc.d/dhcpd restart
/etc/rc.d/dhcpd check

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 1 comment… read it below or add one }

1 Tom February 21, 2014 at 5:14 pm

Why would you kill -9? That should only be used when a process is not responding.

Reply

Leave a Comment

Tagged as: , , , ,

Previous Faq:

Next Faq: