From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Feb 25 20:50:01 2014 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1869EAA3 for ; Tue, 25 Feb 2014 20:50:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC62A1754 for ; Tue, 25 Feb 2014 20:50:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s1PKo0ed001575 for ; Tue, 25 Feb 2014 20:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s1PKo08u001574; Tue, 25 Feb 2014 20:50:00 GMT (envelope-from gnats) Resent-Date: Tue, 25 Feb 2014 20:50:00 GMT Resent-Message-Id: <201402252050.s1PKo08u001574@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Derek Kulinski Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAE65955 for ; Tue, 25 Feb 2014 20:42:54 +0000 (UTC) Received: from newred.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDB5916F4 for ; Tue, 25 Feb 2014 20:42:54 +0000 (UTC) Received: from cgiserv.freebsd.org ([127.0.1.6]) by newred.freebsd.org (8.14.7/8.14.7) with ESMTP id s1PKgrgA027507 for ; Tue, 25 Feb 2014 20:42:54 GMT (envelope-from nobody@cgiserv.freebsd.org) Received: (from nobody@localhost) by cgiserv.freebsd.org (8.14.7/8.14.7/Submit) id s1PKgrCA027506; Tue, 25 Feb 2014 20:42:53 GMT (envelope-from nobody) Message-Id: <201402252042.s1PKgrCA027506@cgiserv.freebsd.org> Date: Tue, 25 Feb 2014 20:42:53 GMT From: Derek Kulinski To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/187072: /usr/local/etc.rc.d/nslcd status returns 0 even when service is not running X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 20:50:01 -0000 >Number: 187072 >Category: ports >Synopsis: /usr/local/etc.rc.d/nslcd status returns 0 even when service is not running >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 25 20:50:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Derek Kulinski >Release: FreeBSD 10.0-RELEASE >Organization: >Environment: FreeBSD salt-testing 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 >Description: /usr/local/etc.rc.d/nslcd status always returns 0 this in turn fools programs like (salt in my case) to think that the service is running while it is not. >How-To-Repeat: root@salt-testing:~ # /usr/local/etc/rc.d/nslcd status nslcd is running with PID 67408. root@salt-testing:~ # echo $? 0 root@salt-testing:~ # /usr/local/etc/rc.d/nslcd stop Stopping nslcd. Waiting for PIDS: 67408. root@salt-testing:~ # /usr/local/etc/rc.d/nslcd status nslcd not running? root@salt-testing:~ # echo $? 0 >Fix: The least invasive way is to basically add "return 1" when service is not running, like this: nslcd_status() { nslcd_findpid if [ ! ${mypid} = '' ]; then echo "${name} is running with PID ${mypid}."; else echo "${name} not running?"; return 1 fi } >Release-Note: >Audit-Trail: >Unformatted: