ports/170899: net-im/openfire rc Script pidfile Check Broken With Bracketed Java Process in Process List

Ryan Frederick ryanrfrederick at gmail.com
Thu Aug 23 00:20:02 UTC 2012


>Number:         170899
>Category:       ports
>Synopsis:       net-im/openfire rc Script pidfile Check Broken With Bracketed Java Process in Process List
>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:   Thu Aug 23 00:20:01 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Ryan Frederick
>Release:        9.0-RELEASE
>Organization:
>Environment:
FreeBSD problem.machine 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 01:47:53 UTC 2012     root at i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
When running net-im/openfire with enough arguments that the Openfire Java process appears in the process list (`ps auxwww`) as a bracketed process, e.g. "[java]", the rc script's pidfile check on lines 68 and 84 fails to return the pidfile and thus successfully display Openfire's status or stop Openfire. 
>How-To-Repeat:
Start Openfire with a sufficient list of arguments specified in openfire_javargs (e.g. openfire_javargs="-Xmx256M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false") to cause the process to be bracketed in the process list, then attempt to run `/usr/local/etc/rc.d/openfire status` or `/usr/local/etc/rc.d/openfire stop`.
>Fix:
Perhaps replace the current check_pidfile subversion with a check_pidfile() subversion method similar to the one found in www/tomcat6:

--SNIP--

tomcat_check_pidfile() {
        _pidfile=$1
        if [ -z "$_pidfile" ]; then
                err 3 'USAGE: tomcat_check_pidfile pidfile'
        fi
        if [ ! -f $_pidfile ]; then
                debug "pid file ($_pidfile): not readable."
                return
        fi
        read _pid _junk < $_pidfile
        if [ -z "$_pid" ]; then
                debug "pid file ($_pidfile): no pid in file."
                return
        fi
        if [ -n "`%%LOCALBASE%%/bin/jps -l | grep -e "^$_pid $java_class\$"`" ]; then
                echo -n $_pid
        fi
}

--SNIP--

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list