Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Apr 2012 17:22:14 +0900 (JST)
From:      Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        turutani@scphys.kyoto-u.ac.jp
Subject:   misc/166783: unexped startup of the daemon
Message-ID:  <201204090822.q398ME53004023@h120.65.226.10.32118.vlan.kuins.net>
Resent-Message-ID: <201204090830.q398UB7I089215@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204090822.q398ME53004023>