misc/166783: unexped startup of the daemon
turutani at scphys.kyoto-u.ac.jp
Mon Apr 9 08:30:12 UTC 2012
>Synopsis: unexped startup of the daemon
>Arrival-Date: Mon Apr 09 08:30:11 UTC 2012
>Originator: Tsurutani Naoki
>Release: FreeBSD 8.2-PRERELEASE i386
System: FreeBSD h184.108.40.206.32118.vlan.kuins.net 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #25: Mon Jan 24 10:37:18 JST 2011 turutani at h220.127.116.11.32118.vlan.kuins.net:/usr/local/work/usr/obj/usr/src/sys/POLYMER i386
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.
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.
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.
More information about the freebsd-bugs