Module Name: src
Committed By: spz
Date: Thu Jul 17 07:17:03 UTC 2014
Modified Files:
src/etc/rc.d: dhcpd
Log Message:
Create the dhcpd.leases file if it doesn't exist already, don't just
warn about it not being there.
Closes PR misc/48868
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/etc/rc.d/dhcpd
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/etc/rc.d/dhcpd
diff -u src/etc/rc.d/dhcpd:1.6 src/etc/rc.d/dhcpd:1.7
--- src/etc/rc.d/dhcpd:1.6 Fri Aug 13 18:08:03 2004
+++ src/etc/rc.d/dhcpd Thu Jul 17 07:17:03 2014
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: dhcpd,v 1.6 2004/08/13 18:08:03 mycroft Exp $
+# $NetBSD: dhcpd,v 1.7 2014/07/17 07:17:03 spz Exp $
#
# PROVIDE: dhcpd
@@ -12,8 +12,17 @@ $_rc_subr_loaded . /etc/rc.subr
name="dhcpd"
rcvar=$name
command="/usr/sbin/${name}"
+start_precmd="dhcpd_precmd"
pidfile="/var/run/${name}.pid"
-required_files="/etc/${name}.conf /var/db/${name}.leases"
+required_files="/etc/${name}.conf"
+
+dhcpd_precmd()
+{
+ if [ ! -e "/var/db/${name}.leases" ]; then
+ echo "Creating /var/db/${name}.leases"
+ touch /var/db/${name}.leases
+ fi
+}
load_rc_config $name
run_rc_command "$1"