Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Sep 2009 14:11:09 -0400
From:      Tom Worster <fsb@thefsb.org>
To:        Mel Flynn <mel.flynn+fbsd.questions@mailing.thruhere.net>, <freebsd-questions@freebsd.org>
Subject:   Re: passing options thru '/etc/rc.d/foo start'
Message-ID:  <C6D6A27D.127D0%fsb@thefsb.org>
In-Reply-To: <200909161935.50758.mel.flynn%2Bfbsd.questions@mailing.thruhere.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/16/09 1:35 PM, "Mel Flynn"
<mel.flynn+fbsd.questions@mailing.thruhere.net> wrote:

> On Wednesday 16 September 2009 18:45:29 Tom Worster wrote:
>> is there a general shell syntax that can be used to pass arguments to a
>> daemon that you're starting with the /etc/rc.d/foo start command?
>> 
>> for example, how does one start sshd using /etc/rc.d/sshd and pass it
>> '-o X11Forwarding=no' without touching a config file?
> 
> You don't. Defaults are set in /etc/defaults/rc.conf, overridden in
> /etc/rc.conf. Unless you add the logic yourself in /etc/rc.conf, the
> environment is not looked at.
> So this means a one-time edit of /etc/rc.conf:
> if test -n "${SSHD_FLAGS}"; then
> sshd_flags="${SSHD_FLAGS}"
> else
> sshd_flags="${sshd_flags}"
> fi
> 
> Then start with SSHD_FLAGS="-o X11Forwarding=no" /etc/rc.d/sshd start
> 
> But this is specific for sshd, as it supports _flags. There's no generic way
> to do this.

thanks, Mel, that's good to know.

i think your suggestion of modifying rc.conf will turn out to be a tidy
solution for me.

tom





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C6D6A27D.127D0%fsb>