Date: Tue, 25 Feb 2014 20:42:53 GMT From: Derek Kulinski <takeda@takeda.tk> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/187072: /usr/local/etc.rc.d/nslcd status returns 0 even when service is not running Message-ID: <201402252042.s1PKgrCA027506@cgiserv.freebsd.org> Resent-Message-ID: <201402252050.s1PKo08u001574@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402252042.s1PKgrCA027506>