From owner-freebsd-bugs@FreeBSD.ORG Fri Aug 11 00:30:18 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F2FB16A4E9 for ; Fri, 11 Aug 2006 00:30:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F98843D49 for ; Fri, 11 Aug 2006 00:30:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k7B0UGiE009130 for ; Fri, 11 Aug 2006 00:30:17 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k7B0UGbN009125; Fri, 11 Aug 2006 00:30:16 GMT (envelope-from gnats) Resent-Date: Fri, 11 Aug 2006 00:30:16 GMT Resent-Message-Id: <200608110030.k7B0UGbN009125@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, Clement Moulin Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5281416A4DE for ; Fri, 11 Aug 2006 00:20:31 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A5D643D49 for ; Fri, 11 Aug 2006 00:20:31 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k7B0KUtg061315 for ; Fri, 11 Aug 2006 00:20:30 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k7B0KUPU061314; Fri, 11 Aug 2006 00:20:30 GMT (envelope-from nobody) Message-Id: <200608110020.k7B0KUPU061314@www.freebsd.org> Date: Fri, 11 Aug 2006 00:20:30 GMT From: Clement Moulin To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: conf/101791: rc.subr : function _find_processes cannot find process with name in [ ] 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: Fri, 11 Aug 2006 00:30:18 -0000 >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@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: