From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Apr 25 13:10:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CEC726D8 for ; Thu, 25 Apr 2013 13:10:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id AFB3E13B0 for ; Thu, 25 Apr 2013 13:10:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r3PDA0LR096398 for ; Thu, 25 Apr 2013 13:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r3PDA0d4096396; Thu, 25 Apr 2013 13:10:00 GMT (envelope-from gnats) Resent-Date: Thu, 25 Apr 2013 13:10:00 GMT Resent-Message-Id: <201304251310.r3PDA0d4096396@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, Alexander Yerenkow Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3E66F4B4 for ; Thu, 25 Apr 2013 13:00:46 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 2FDA3131F for ; Thu, 25 Apr 2013 13:00:46 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r3PD0jBj004474 for ; Thu, 25 Apr 2013 13:00:45 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id r3PD0jxj004473; Thu, 25 Apr 2013 13:00:45 GMT (envelope-from nobody) Message-Id: <201304251300.r3PD0jxj004473@red.freebsd.org> Date: Thu, 25 Apr 2013 13:00:45 GMT From: Alexander Yerenkow To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/178142: jboss72 update of changed github tarballs plus enhance rc script X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 13:10:00 -0000 >Number: 178142 >Category: ports >Synopsis: jboss72 update of changed github tarballs plus enhance rc script >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Apr 25 13:10:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Alexander Yerenkow >Release: FreeBSD 9.1 >Organization: >Environment: >Description: jboss72 update of changed github tarballs plus enhance rc script: RC script now can be tuned to hard way kill stuck JBoss or any child processes preventing restart; RC script can be configured to make a delay after killing (for example for restart). >How-To-Repeat: >Fix: Patch attached with submission follows: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # jboss72/files/jboss72.in # echo x - jboss72/files/jboss72.in sed 's/^X//' >jboss72/files/jboss72.in << 'a192e971ca37e5168d8ee2a7f5ff7f28' X#!/bin/sh X# X# %%APP_SHORTNAME%% startup script. X# X# $FreeBSD: java/jboss72/files/jboss72.in 314186 2013-03-14 21:22:00Z crees $ X# X X# PROVIDE: %%APP_SHORTNAME%% X# REQUIRE: NETWORKING SERVERS X X# Add the following lines to /etc/rc.conf to enable %%APP_SHORTNAME%%: X# %%APP_SHORTNAME%%_enable (bool): Set to "YES" to enable %%APP_SHORTNAME%% X# %%APP_SHORTNAME%%_jvm_opts (str): Extra JVM flags. X# %%APP_SHORTNAME%%_args (str): Optional arguments to JBoss X# %%APP_SHORTNAME%%_logging (str) JBoss log output. A pipe command may be used. X# X X. /etc/rc.subr X X%%APP_SHORTNAME%%_user="%%USER%%" X%%APP_SHORTNAME%%_logdir="%%LOG_DIR%%" X Xname="%%APP_SHORTNAME%%" Xrcvar=%%APP_SHORTNAME%%_enable X Xload_rc_config $name X X%%APP_SHORTNAME%%_enable="${%%APP_SHORTNAME%%_enable:-"NO"}" X%%APP_SHORTNAME%%_logging="${%%APP_SHORTNAME%%_logging:-">> ${%%APP_SHORTNAME%%_logdir}/stdout.log 2>> ${%%APP_SHORTNAME%%_logdir}/stderr.log"}" X%%APP_SHORTNAME%%_sleep="${%%APP_SHORTNAME%%_sleep:-"5"}" X%%APP_SHORTNAME%%_kill9="${%%APP_SHORTNAME%%_kill9:-""}" X%%APP_SHORTNAME%%_additional_killall="${%%APP_SHORTNAME%%_additional_killall:-""}" X Xstart_cmd="%%APP_SHORTNAME%%_start" Xstop_cmd="%%APP_SHORTNAME%%_stop" Xpidfile="%%PID_FILE%%" X XJBOSS_HOME="%%APP_HOME%%" X X%%APP_SHORTNAME%%_start () X{ X if [ ! -d "${%%APP_SHORTNAME%%_logdir}" ] X then X mkdir -p ${%%APP_SHORTNAME%%_logdir} X chown ${%%APP_SHORTNAME%%_user} ${%%APP_SHORTNAME%%_logdir} X fi X X echo "Starting %%APP_SHORTNAME%%." X daemon -u ${%%APP_SHORTNAME%%_user} ${JBOSS_HOME}/bin/standalone.sh ${%%APP_SHORTNAME%%_logging} >> ${%%APP_SHORTNAME%%_logdir}/boot.log 2>> ${%%APP_SHORTNAME%%_logdir}/boot.log X X sleep ${%%APP_SHORTNAME%%_sleep} # let daemon(8) and sh(1) finish before executing pgrep(1) X pgrep -U ${%%APP_SHORTNAME%%_user} -f ${JBOSS_HOME}/modules > ${pidfile} X chown ${%%APP_SHORTNAME%%_user} $pidfile X} X X%%APP_SHORTNAME%%_stop () X{ X # Subvert the check_pid_file procname check. X if [ -f ${pidfile} ] X then X kill `cat ${pidfile}` X # Only if we aware that our setup can hangs, and only after trying simple kill, we can kill it hard way. X if [ ! -z "${%%APP_SHORTNAME%%_kill9}" ] X then X sleep ${%%APP_SHORTNAME%%_sleep} X kill -9 `cat ${pidfile}` X fi X # In some setups, JBoss can spawn some child processess, which could prevent it from stopping, and freeing net ports. X # Let's blindly kill them all, since we are really know what we are doing. X if [ ! -z "${%%APP_SHORTNAME%%_additional_killall}" ] X then X sleep ${%%APP_SHORTNAME%%_sleep} X killall ${%%APP_SHORTNAME%%_additional_killall} X fi X fi X} X Xrun_rc_command "$1" a192e971ca37e5168d8ee2a7f5ff7f28 exit >Release-Note: >Audit-Trail: >Unformatted: