rc.conf.d improvement
Lars Engels
lars.engels at 0x20.net
Thu Aug 14 19:55:56 UTC 2014
On Mon, Aug 11, 2014 at 03:47:52PM +0200, Dag-Erling Smørgrav wrote:
> The attached patch does two things:
>
> 1) Add /etc/rc.conf.d to BSD.root.mtree so it's created during
> installation;
Yes, please do that.
It's also related to https://reviews.freebsd.org/D451
If it's added to mtree I don't need to check for it in service(8).
>
> 2) Modify rc.subr so that if /etc/rc.conf.d/<service> is a directory,
> all of the files it contains are included.
>
Also a good idea.
> Comments or objections?
>
> DES
> --
> Dag-Erling Smørgrav - des at des.no
>
> 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.
> _______________________________________________
> freebsd-rc at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-rc
> To unsubscribe, send any mail to "freebsd-rc-unsubscribe at freebsd.org"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 618 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20140814/9914184e/attachment.sig>
More information about the freebsd-rc
mailing list