From owner-freebsd-rc@FreeBSD.ORG Wed Oct 26 05:10:36 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC8AA16A41F for ; Wed, 26 Oct 2005 05:10:36 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3779743D45 for ; Wed, 26 Oct 2005 05:10:35 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.3/8.13.3) with ESMTP id j9Q5AUU2037354; Wed, 26 Oct 2005 09:10:30 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.3/8.13.3/Submit) id j9Q5AT30037353; Wed, 26 Oct 2005 09:10:29 +0400 (MSD) (envelope-from yar) Date: Wed, 26 Oct 2005 09:10:29 +0400 From: Yar Tikhiy To: freebsd-rc@freebsd.org Message-ID: <20051026051029.GA32620@comp.chem.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i Cc: Subject: A fix for `restart' X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2005 05:10:37 -0000 Folks, Would you mind testing the following patch to /etc/rc.subr that should remedy problems with `restart', e.g., as found for /etc/rc.d/jail? It is safe as it doesn't affect other commans and hence it won't disrupt your boot sequence :-) I'm just concerned about possible side-effects for restart I might have overlooked. The test case of scripts taking additional arguments besides the command is the most intriguing. ----- Begin patch ----- --- //depot/user/yar/hack/etc/rc.subr 2005/10/26 04:02:40 +++ //depot/user/yar/hack/etc/rc.subr 2005/10/26 04:57:21 @@ -770,8 +770,9 @@ fi _rc_restart_done=true - ( $0 ${_rc_prefix}stop $rc_extra_args ) - $0 ${_rc_prefix}start $rc_extra_args + # run stop in a subshell to keep variables for start + ( run_rc_command ${_rc_prefix}stop $rc_extra_args ) + run_rc_command ${_rc_prefix}start $rc_extra_args if [ -n "$_postcmd" ]; then eval $_postcmd $rc_extra_args ----- End patch ----- -- Yar