From 75a9ccf04752bc85a3d67296dd20deb056c92340 Mon Sep 17 00:00:00 2001 From: form <> Date: Wed, 19 Aug 1998 04:25:49 +0000 Subject: [PATCH] dhcpd: start from rc, controlled by rc.conf; sample config files --- src/etc/dhcpd.conf | 22 ++++++++++++++++++++++ src/etc/dhcpd.interfaces | 7 +++++++ src/etc/rc | 20 +++++++++++--------- src/etc/rc.conf | 4 ++-- 4 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 src/etc/dhcpd.conf create mode 100644 src/etc/dhcpd.interfaces diff --git a/src/etc/dhcpd.conf b/src/etc/dhcpd.conf new file mode 100644 index 00000000..a137f20b --- /dev/null +++ b/src/etc/dhcpd.conf @@ -0,0 +1,22 @@ +# $OpenBSD: dhcpd.conf,v 1.1 1998/08/19 04:25:45 form Exp $ +# +# DHCP server options. +# See dhcpd.conf(5) and dhcpd(8) for more information. +# + +# Network: 192.168.1.0/255.255.255.0 +# Domain name: my.domain +# Name servers: 192.168.1.3 and 192.168.1.5 +# Default router: 192.168.1.1 +# Addresses: 192.168.1.32 - 192.168.1.127 +# +shared-network LOCAL-NET { + option domain-name "my.domain"; + option domain-name-servers 192.168.1.3, 192.168.1.5; + + subnet 192.168.1.0 netmask 255.255.255.0 { + option routers 192.168.1.1; + + range 192.168.1.32 192.168.1.127; + } +} diff --git a/src/etc/dhcpd.interfaces b/src/etc/dhcpd.interfaces new file mode 100644 index 00000000..f06c4d8f --- /dev/null +++ b/src/etc/dhcpd.interfaces @@ -0,0 +1,7 @@ +# $OpenBSD: dhcpd.interfaces,v 1.1 1998/08/19 04:25:45 form Exp $ +# +# List of network interfaces served by dhcpd(8). +# +# ep0 +# ed0 le0 +# de1 diff --git a/src/etc/rc b/src/etc/rc index 8b47f8fd..ef9c36fe 100644 --- a/src/etc/rc +++ b/src/etc/rc @@ -1,4 +1,4 @@ -# $OpenBSD: rc,v 1.85 1998/08/18 23:54:41 marc Exp $ +# $OpenBSD: rc,v 1.86 1998/08/19 04:25:46 form Exp $ # System startup script run by init on autoboot # or after single-user. @@ -333,6 +333,16 @@ if [ "X${mrouted_flags}" != X"NO" ]; then echo -n ' mrouted'; mrouted $mrouted_flags fi +# $dhcpd_flags is imported from /etc/rc.conf +# If $dhcpd_flags == NO or /etc/dhcpd.conf doesn't exist, then dhcpd isn't run. +if [ "X${dhcpd_flags}" != X"NO" -a -f /etc/dhcpd.conf ]; then + touch /var/db/dhcpd.leases + if [ -f /etc/dhcpd.interfaces ]; then + dhcpd_ifs=`cat /etc/dhcpd.interfaces | awk -F\# '{ print $1; }'` + fi + echo -n ' dhcpd'; /usr/sbin/dhcpd ${dhcpd_flags} ${dhcpd_ifs} +fi + # $rwhod is imported from /etc/rc.conf; # if $rwhod == YES, rwhod is run. if [ X${rwhod} = X"YES" ]; then @@ -435,15 +445,7 @@ fi [ -f /etc/rc.local ] && . /etc/rc.local echo -n standard daemons: - -# $apmd_flags is imported from /etc/rc.conf; -# don't run daemon if $apmd_flags == NO or /usr/sbin/apmd doesn't exist -if [ "X${apmd_flags}" != X"NO" -a -x /usr/sbin/apmd ]; then - echo -n ' apmd'; /usr/sbin/apmd ${apmd_flags} -fi - echo -n ' cron'; cron - echo '.' date diff --git a/src/etc/rc.conf b/src/etc/rc.conf index bc8c5e52..71a2d742 100644 --- a/src/etc/rc.conf +++ b/src/etc/rc.conf @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: rc.conf,v 1.25 1998/08/18 23:54:42 marc Exp $ +# $OpenBSD: rc.conf,v 1.26 1998/08/19 04:25:49 form Exp $ # set these to "NO" to turn them off. otherwise, they're used as flags routed_flags=NO # for 'normal' use: routed_flags="-q" @@ -15,7 +15,7 @@ timed_flags=NO # for 'normal' use: timed_flags="" photurisd_flags=NO # for 'normal' use: photurisd_flags="" mopd_flags=NO # for 'normal' use: mopd_flags="-a" httpd_flags=NO # for 'normal' use: httpd_flags="" -apmd_flags=NO # for 'normal' use: apmd_flags="" +dhcpd_flags=NO # for 'normal' use: dhcpd_flags="-q" # On some architectures, you must also disable console getty in /etc/ttys xdm_flags=NO # for 'normal' use: xdm_flags=""