Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc/rc.d Create the dhcpd.leases file if it doesn't exist al...



details:   https://anonhg.NetBSD.org/src/rev/046f2b08b20c
branches:  trunk
changeset: 330657:046f2b08b20c
user:      spz <spz%NetBSD.org@localhost>
date:      Thu Jul 17 07:17:03 2014 +0000

description:
Create the dhcpd.leases file if it doesn't exist already, don't just
warn about it not being there.
Closes PR misc/48868

diffstat:

 etc/rc.d/dhcpd |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 98675495ecac -r 046f2b08b20c etc/rc.d/dhcpd
--- a/etc/rc.d/dhcpd    Thu Jul 17 06:27:52 2014 +0000
+++ b/etc/rc.d/dhcpd    Thu Jul 17 07:17:03 2014 +0000
@@ -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 @@
 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"



Home | Main Index | Thread Index | Old Index