Date: Fri, 24 Mar 2006 12:56:27 -0800 From: Brooks Davis <brooks@one-eyed-alien.net> To: Florent Thoumie <flz@xbsd.org> Cc: freebsd-rc@freebsd.org Subject: Re: rc.subr / rc.d/sshd patch for review Message-ID: <20060324205627.GA18100@odin.ac.hmc.edu> In-Reply-To: <1143202549.16053.145.camel@mayday.esat.net> References: <1143202549.16053.145.camel@mayday.esat.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Fri, Mar 24, 2006 at 12:15:49PM +0000, Florent Thoumie wrote:
> This is based on Oliver's patch for rc.d/sshd that can be found in
> Gnats.
>
> In load_rc_config, I'm extracting prefix from ${command} (or
> ${name}_program, which part is moved from run_rc_command), and setting
> etcdir accordingly.
>
> The point is that some scripts (like rc.d/sshd) can be used for base
> sshd as well as ports sshd, and makes possible to source
> ${prefix}/etc/rc.conf.d/${name}.
>
> This patch also documents ${name}_program above run_rc_command (though
> it's actually used in load_rc_config).
Is command always set? I'm pretty sure it isn't so this may not be entierly
safe. If it's not set, should we try to guess prefix from $0?
The other issue I see is that instead of:
if [ -f ${etcdir}/rc.conf.d/"$_command" ]; then
debug "Sourcing ${etcdir}/rc.conf.d/${_command}"
. ${etcdir}/rc.conf.d/"$_command"
fi
I think we should do:
if [ -f /etc/rc.conf.d/"$_command" ]; then
debug "Sourcing /etc/rc.conf.d/${_command}"
. /etc/rc.conf.d/"$_command"
fi
if [ "${etcdir}" != "/etc" -a -f ${etcdir}/rc.conf.d/"$_command" ]; then
debug "Sourcing ${etcdir}/rc.conf.d/${_command}"
. ${etcdir}/rc.conf.d/"$_command"
fi
That preserves the old behavior while adding support for
${prefix}/etc/rc.conf.d.
-- Brooks
--
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQFEJFz6XY6L6fI4GtQRAgZzAJ9V+VA2SSxnufdXoOot+XM/7Yk75ACgvyzT
DtvudLi5ZuXgr1E9qBFjKFc=
=ZpeL
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060324205627.GA18100>
