Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Feb 2014 20:57:13 GMT
From:      Derek Kulinski <takeda@takeda.tk>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/187073: net/nss-pam-ldapd: service nslcd status always returns 0
Message-ID:  <201402252057.s1PKvDa8062596@cgiserv.freebsd.org>
Resent-Message-ID: <201402252100.s1PL010k004455@freefall.freebsd.org>

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

>Number:         187073
>Category:       ports
>Synopsis:       net/nss-pam-ldapd: service nslcd status always returns 0
>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 21:00:01 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:
service nslcd status always returns 0, causing automated tools such as saltstack in my case to assume the service is running when 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 fix is to add return 1 when the service is not running, like here:

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:



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