From owner-freebsd-bugs@FreeBSD.ORG Mon Apr 9 08:30:12 2012 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 400FA106567A for ; Mon, 9 Apr 2012 08:30:12 +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 EEBF28FC14 for ; Mon, 9 Apr 2012 08:30:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q398UBeV089217 for ; Mon, 9 Apr 2012 08:30:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q398UB7I089215; Mon, 9 Apr 2012 08:30:11 GMT (envelope-from gnats) Resent-Date: Mon, 9 Apr 2012 08:30:11 GMT Resent-Message-Id: <201204090830.q398UB7I089215@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, Tsurutani Naoki Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46A47106566B for ; Mon, 9 Apr 2012 08:22:23 +0000 (UTC) (envelope-from turutani@scphys.kyoto-u.ac.jp) Received: from smtp-auth.kuins.kyoto-u.ac.jp (smtp-auth.kuins.kyoto-u.ac.jp [133.3.248.237]) by mx1.freebsd.org (Postfix) with ESMTP id D5BB38FC0A for ; Mon, 9 Apr 2012 08:22:22 +0000 (UTC) Received: from smtp-auth.kuins.kyoto-u.ac.jp (smtp-auth.kuins.kyoto-u.ac.jp [127.0.0.1]) by postfix.imss70 (Postfix) with ESMTP id 79A4E2EC003; Mon, 9 Apr 2012 17:22:21 +0900 (JST) Received: from h120.65.226.10.32118.vlan.kuins.net (wd232.BFL23.vectant.ne.jp [210.131.195.232]) by smtp-auth.kuins.kyoto-u.ac.jp (Postfix) with ESMTP id 56F772EC001; Mon, 9 Apr 2012 17:22:21 +0900 (JST) Received: from h120.65.226.10.32118.vlan.kuins.net (localhost [127.0.0.1]) by h120.65.226.10.32118.vlan.kuins.net (8.14.4/8.14.4/20071004-1) with ESMTP id q398MGxx004024; Mon, 9 Apr 2012 17:22:16 +0900 (JST) (envelope-from turutani@h120.65.226.10.32118.vlan.kuins.net) Received: (from turutani@localhost) by h120.65.226.10.32118.vlan.kuins.net (8.14.4/8.14.4/Submit) id q398ME53004023; Mon, 9 Apr 2012 17:22:14 +0900 (JST) (envelope-from turutani) Message-Id: <201204090822.q398ME53004023@h120.65.226.10.32118.vlan.kuins.net> Date: Mon, 9 Apr 2012 17:22:14 +0900 (JST) From: Tsurutani Naoki To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: turutani@scphys.kyoto-u.ac.jp Subject: misc/166783: unexped startup of the daemon X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Tsurutani Naoki List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 08:30:12 -0000 >Number: 166783 >Category: misc >Synopsis: unexped startup of the daemon >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Apr 09 08:30:11 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Tsurutani Naoki >Release: FreeBSD 8.2-PRERELEASE i386 >Organization: >Environment: System: FreeBSD h120.65.226.10.32118.vlan.kuins.net 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #25: Mon Jan 24 10:37:18 JST 2011 turutani@h120.65.226.10.32118.vlan.kuins.net:/usr/local/work/usr/obj/usr/src/sys/POLYMER i386 >Description: some rc scripts are run unexpectedly. "XXX_enable" variable controls whether the program pointed in the script should be run or not, however, disabled script can be run with normal "start" option. when I execute a script, first, the PID file is checked even if the script is not enabled by rc.conf. If the PID file exists and the process shown in PID file also exists, scripts returns message like "the process still exists". however, if it is executed with "faststart" argument, PID file is removed and the program is executed. in both case, scripts that are not enabled by rc.conf are executed, and the variables except "XXX_enable" type are used unexpectedly. if two scripts use the same PID file and the only one of the scripts is enabled by rc.conf, and when they have same "program" like some interpreter language especially, unexpected programs can be run. >How-To-Repeat: I install ports/net-mgmt/mrtg and I use the startup script copied from the one installed by this port, in order to change the order to run. I named the script and variables with "my_" prefix and enable them; original script exists and disabled. I did not changed the PID filename; when booting the FreeBSD, "my_mrtg_daemon" scripts runs fine, and "mrtg_daemon" scripts is run unexpectedly and dies with "PID file is not written". original pid file made by "my_mrtg_daemon" is removed at that time; for the user and group used to run the mrtg are changed only in my script. if the user and group are changed to use the original ones, two mrtg daemons are run. >Fix: I have no idea. I think scripts without "XXX_enable=YES" should not run, even the PID check; otherwise, we should take care the variables which are not enabled. In addition, some bugs that run the "start" routine of not enabled scripts. >Release-Note: >Audit-Trail: >Unformatted: