From owner-freebsd-questions@FreeBSD.ORG Wed Sep 16 17:35:53 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A9A31065679 for ; Wed, 16 Sep 2009 17:35:53 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 6D0228FC18 for ; Wed, 16 Sep 2009 17:35:53 +0000 (UTC) Received: from smoochies.rachie.is-a-geek.net (mailhub.lan.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id A6E187E818; Wed, 16 Sep 2009 09:36:05 -0800 (AKDT) From: Mel Flynn To: freebsd-questions@freebsd.org Date: Wed, 16 Sep 2009 19:35:50 +0200 User-Agent: KMail/1.12.1 (FreeBSD/8.0-BETA4; KDE/4.3.1; i386; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200909161935.50758.mel.flynn+fbsd.questions@mailing.thruhere.net> Cc: Tom Worster Subject: Re: passing options thru '/etc/rc.d/foo start' X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2009 17:35:53 -0000 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. -- Mel