Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Aug 2014 15:47:52 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        freebsd-rc@freebsd.org
Subject:   rc.conf.d improvement
Message-ID:  <86a97bp27r.fsf@nine.des.no>

next in thread | raw e-mail | index | archive | help
--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

The attached patch does two things:

1) Add /etc/rc.conf.d to BSD.root.mtree so it's created during
   installation;

2) Modify rc.subr so that if /etc/rc.conf.d/<service> is a directory,
   all of the files it contains are included.

Comments or objections?

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=rc-conf-d.diff

Index: etc/mtree/BSD.root.dist
===================================================================
--- etc/mtree/BSD.root.dist	(revision 269808)
+++ etc/mtree/BSD.root.dist	(working copy)
@@ -60,6 +60,8 @@
         ..
         ppp
         ..
+        rc.conf.d
+        ..
         rc.d
         ..
         security
Index: etc/rc.subr
===================================================================
--- etc/rc.subr	(revision 269808)
+++ etc/rc.subr	(working copy)
@@ -1290,8 +1290,14 @@
 		_rc_conf_loaded=true
 	fi
 	if [ -f /etc/rc.conf.d/"$_name" ]; then
-		debug "Sourcing /etc/rc.conf.d/${_name}"
+		debug "Sourcing /etc/rc.conf.d/$_name"
 		. /etc/rc.conf.d/"$_name"
+	elif [ -d /etc/rc.conf.d/"$_name" ] ; then
+		local _rc
+		for _rc in $(/bin/ls /etc/rc.conf.d/"$_name") ; do
+			debug "Sourcing /etc/rc.conf.d/$_name/$_rc"
+			. "/etc/rc.conf.d/$_name/$_rc"
+		done
 	fi
 
 	# Set defaults if defined.

--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86a97bp27r.fsf>