From owner-freebsd-questions@FreeBSD.ORG Wed Sep 16 18:11:16 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 EEE0A1065676 for ; Wed, 16 Sep 2009 18:11:16 +0000 (UTC) (envelope-from fsb@thefsb.org) Received: from smtp184.iad.emailsrvr.com (smtp184.iad.emailsrvr.com [207.97.245.184]) by mx1.freebsd.org (Postfix) with ESMTP id 9403A8FC08 for ; Wed, 16 Sep 2009 18:11:16 +0000 (UTC) Received: from relay8.relay.iad.mlsrvr.com (localhost [127.0.0.1]) by relay8.relay.iad.mlsrvr.com (SMTP Server) with ESMTP id 18F48202DFE; Wed, 16 Sep 2009 14:11:16 -0400 (EDT) Received: by relay8.relay.iad.mlsrvr.com (Authenticated sender: fsb-AT-thefsb.org) with ESMTPSA id 76726202DCD; Wed, 16 Sep 2009 14:11:14 -0400 (EDT) User-Agent: Microsoft-Entourage/12.10.0.080409 Date: Wed, 16 Sep 2009 14:11:09 -0400 From: Tom Worster To: Mel Flynn , Message-ID: Thread-Topic: passing options thru '/etc/rc.d/foo start' Thread-Index: Aco2+RDLGTks4frdN0qW9D2OWx31hA== In-Reply-To: <200909161935.50758.mel.flynn+fbsd.questions@mailing.thruhere.net> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Cc: 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 18:11:17 -0000 On 9/16/09 1:35 PM, "Mel Flynn" 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