conf/101791: rc.subr : function _find_processes cannot find process
with name in [ ]
Clement Moulin
freebsd at simplerezo.com
Fri Aug 11 00:30:18 UTC 2006
>Number: 101791
>Category: conf
>Synopsis: rc.subr : function _find_processes cannot find process with name in [ ]
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Aug 11 00:30:16 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Clement Moulin
>Release: 5.3-RELEASE
>Organization:
SimpleRezo
>Environment:
FreeBSD xxx.com 5.3-RELEASE-p9 FreeBSD 5.3-RELEASE-p9 #0: Wed Apr 27 16:05:49 CEST 2005 root at xxx.com:/usr/obj/usr/src/sys/KERNEL i386
>Description:
The /etc/rc.subr script contains a function check_pidfile that calls _find_processes to check if a file containing a pid is referencing a running process matching a specific name.
It's due to /bin/sh 'case' struct.
Try:
#!/bin/sh
my="[tcp]"
case ${my} in
${my}) echo no;;
"${my}") echo yes;;
esac
In /etc/rc.subr:
_fp_match='case "$_arg0" in
$_procname|$_procnamebn|${_procnamebn}:|"(${_procnamebn})")'
BTW, i don't understand why both $_procnamebn and ${_procnamebn} are there...
>How-To-Repeat:
Try to manage with an rcNG script a daemon who display in ps in "[]", ie tcpserver:
21478 p0 I 0:00,00 [tcpserver]
check_pidfile ${pidfile} '[tcpserver]'
This call doesn't returns any result.
>Fix:
In /etc/rc.subr:
-_fp_match='case "$_arg0" in
$_procname|$_procnamebn|${_procnamebn}:|"(${_procnamebn})")'
+_fp_match='case "$_arg0" in
$_procname|"$_procnamebn"|${_procnamebn}:|"(${_procnamebn})")'
Or maybe...
+_fp_match='case "$_arg0" in
"$_procname"|"$_procnamebn"|"${_procnamebn}:"|"(${_procnamebn})")'
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list