From owner-freebsd-bugs@FreeBSD.ORG Mon Jan 12 11:20:03 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1970A106571F for ; Mon, 12 Jan 2009 11:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CF8728FC18 for ; Mon, 12 Jan 2009 11:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CBK2j8003847 for ; Mon, 12 Jan 2009 11:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n0CBK2aM003846; Mon, 12 Jan 2009 11:20:02 GMT (envelope-from gnats) Resent-Date: Mon, 12 Jan 2009 11:20:02 GMT Resent-Message-Id: <200901121120.n0CBK2aM003846@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dominic Fandrey Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34A6E1065B63 for ; Mon, 12 Jan 2009 11:13:54 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id F161A8FC30 for ; Mon, 12 Jan 2009 11:13:53 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CBDr6e052667 for ; Mon, 12 Jan 2009 11:13:53 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n0CBDrnB052666; Mon, 12 Jan 2009 11:13:53 GMT (envelope-from nobody) Message-Id: <200901121113.n0CBDrnB052666@www.freebsd.org> Date: Mon, 12 Jan 2009 11:13:53 GMT From: Dominic Fandrey To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/130414: rc services started with onestart are not stopped upon shutdown X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 11:20:15 -0000 >Number: 130414 >Category: misc >Synopsis: rc services started with onestart are not stopped upon shutdown >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 12 11:20:02 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Dominic Fandrey >Release: RELENG_7 >Organization: private >Environment: FreeBSD mobileKamikaze.norad 7.1-STABLE FreeBSD 7.1-STABLE #1: Tue Jan 6 22:28:13 CET 2009 root@mobileKamikaze.norad:/usr/obj/HP6510b/amd64/usr/src/sys/HP6510b amd64 >Description: On development machines I often start services with onestart (e.g. /usr/local/etc/rc.d apache22 onestart). I do not set rcvar for these services, because I only require them for testing and development. The appended fix makes sure that the rc commands are executed without rcvar set if the service is running. This ensures the execution of the stop_cmd during system shutdown and makes the status and stop commands work without the one or force prefix. I have so far not stumbled over any problems caused by this. >How-To-Repeat: >Fix: --- src/etc/rc.subr.orig 2009-01-12 11:40:37.000000000 +0100 +++ src/etc/rc.subr 2009-01-12 12:00:16.000000000 +0100 @@ -603,19 +603,19 @@ fi fi + eval $_pidcmd # determine the pid + # if ${rcvar} is set, and $1 is not # "rcvar", then run # checkyesno ${rcvar} # and return if that failed # - if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" ]; then + if [ -z "$rc_pid" -a -n "${rcvar}" -a "$rc_arg" != "rcvar" ]; then if ! checkyesno ${rcvar}; then return 0 fi fi - eval $_pidcmd # determine the pid if necessary - for _elem in $_keywords; do if [ "$_elem" != "$rc_arg" ]; then continue >Release-Note: >Audit-Trail: >Unformatted: