ports/187073: net/nss-pam-ldapd: service nslcd status always returns 0
Derek Kulinski
takeda at takeda.tk
Tue Feb 25 21:00:01 UTC 2014
>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 at 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 at salt-testing:~ # /usr/local/etc/rc.d/nslcd status
nslcd is running with PID 67408.
root at salt-testing:~ # echo $?
0
root at salt-testing:~ # /usr/local/etc/rc.d/nslcd stop
Stopping nslcd.
Waiting for PIDS: 67408.
root at salt-testing:~ # /usr/local/etc/rc.d/nslcd status
nslcd not running?
root at 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:
More information about the freebsd-ports-bugs
mailing list