From owner-svn-ports-head@freebsd.org Wed Mar 13 17:08:57 2019 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8943A153A3D7; Wed, 13 Mar 2019 17:08:57 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 298A88A479; Wed, 13 Mar 2019 17:08:57 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19F9DD81E; Wed, 13 Mar 2019 17:08:57 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2DH8u6u028517; Wed, 13 Mar 2019 17:08:56 GMT (envelope-from pi@FreeBSD.org) Received: (from pi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2DH8u0A028516; Wed, 13 Mar 2019 17:08:56 GMT (envelope-from pi@FreeBSD.org) Message-Id: <201903131708.x2DH8u0A028516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pi set sender to pi@FreeBSD.org using -f From: Kurt Jaeger Date: Wed, 13 Mar 2019 17:08:56 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r495622 - head/java/wildfly16/files X-SVN-Group: ports-head X-SVN-Commit-Author: pi X-SVN-Commit-Paths: head/java/wildfly16/files X-SVN-Commit-Revision: 495622 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 298A88A479 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Mar 2019 17:08:57 -0000 Author: pi Date: Wed Mar 13 17:08:56 2019 New Revision: 495622 URL: https://svnweb.freebsd.org/changeset/ports/495622 Log: New port: java/wildfly16 - also re-add files/ PR: 236464 Submitted by: Simeo Reig Added: head/java/wildfly16/files/wildfly16.in (contents, props changed) Deleted: head/java/wildfly16/files/wildfly15.in Added: head/java/wildfly16/files/wildfly16.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/java/wildfly16/files/wildfly16.in Wed Mar 13 17:08:56 2019 (r495622) @@ -0,0 +1,98 @@ +#!/bin/sh +# +# %%APP_SHORTNAME%% startup script. +# $FreeBSD$ +# + +# PROVIDE: %%APP_SHORTNAME%% +# REQUIRE: NETWORKING SERVERS +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf to enable %%APP_SHORTNAME%%: +# %%APP_SHORTNAME%%_enable (bool): Set to "YES" to enable %%APP_SHORTNAME%% +# %%APP_SHORTNAME%%_args (str): Optional arguments to OAJBoss +# %%APP_SHORTNAME%%_log_stdout (str) JBoss log output stdout, filename. +# %%APP_SHORTNAME%%_log_stderr (str) JBoss log output stderr, filename. +# + +. /etc/rc.subr + +name="%%APP_SHORTNAME%%" +rcvar=%%APP_SHORTNAME%%_enable +extra_commands="status" + +load_rc_config $name + +%%APP_SHORTNAME%%_logdir="%%LOG_DIR%%" +%%APP_SHORTNAME%%_enable="${%%APP_SHORTNAME%%_enable:-"NO"}" +%%APP_SHORTNAME%%_log_stdout="${%%APP_SHORTNAME%%_log_stdout:-"${%%APP_SHORTNAME%%_logdir}/log"}" +%%APP_SHORTNAME%%_log_stderr="${%%APP_SHORTNAME%%_log_stderr:-"${%%APP_SHORTNAME%%_logdir}/error"}" +%%APP_SHORTNAME%%_args="${%%APP_SHORTNAME%%_args:-""}" +%%APP_SHORTNAME%%_sleep="${%%APP_SHORTNAME%%_sleep:-"5"}" +%%APP_SHORTNAME%%_kill9="${%%APP_SHORTNAME%%_kill9:-""}" +%%APP_SHORTNAME%%_additional_killall="${%%APP_SHORTNAME%%_additional_killall:-""}" +%%APP_SHORTNAME%%_user="%%USER%%" +%%APP_SHORTNAME%%_group="%%GROUP%%" + +start_cmd="%%APP_SHORTNAME%%_start" +stop_cmd="%%APP_SHORTNAME%%_stop" +pidfile="%%PID_FILE%%" +status_cmd="%%APP_SHORTNAME%%_status" + +WILDFLY_HOME="%%APP_HOME%%" +#minimal requirements must be set for our javavmwrapper +JAVA_VERSION="1.8+" +export JAVA_VERSION + +%%APP_SHORTNAME%%_start () +{ + if [ ! -d "${%%APP_SHORTNAME%%_logdir}" ] + then + install -d -o ${%%APP_SHORTNAME%%_user} ${%%APP_SHORTNAME%%_logdir} + fi + + echo "%%APP_SHORTNAME%%: making sure all writeable dirs belong to proper user/group" + chown -R ${%%APP_SHORTNAME%%_user}:${%%APP_SHORTNAME%%_group} ${WILDFLY_HOME}/standalone + echo "Starting %%APP_SHORTNAME%%." + daemon -u ${%%APP_SHORTNAME%%_user} ${WILDFLY_HOME}/bin/standalone.sh ${%%APP_SHORTNAME%%_args} >> ${%%APP_SHORTNAME%%_log_stdout} 2>> ${%%APP_SHORTNAME%%_log_stderr} + + sleep ${%%APP_SHORTNAME%%_sleep} # let daemon(8) and sh(1) finish before executing pgrep(1) + pgrep -U ${%%APP_SHORTNAME%%_user} -f ${WILDFLY_HOME}/modules > ${pidfile} + chown ${%%APP_SHORTNAME%%_user} $pidfile +} + +%%APP_SHORTNAME%%_stop () +{ + # Subvert the check_pid_file procname check. + if [ -f ${pidfile} ] + then + kill `cat ${pidfile}` + # Only if we aware that our setup can hangs, and only after trying simple kill, we can kill it hard way. + if [ ! -z "${%%APP_SHORTNAME%%_kill9}" ] + then + sleep ${%%APP_SHORTNAME%%_sleep} + kill -9 `cat ${pidfile}` + fi + # In some setups, JBoss can spawn some child processess, which could prevent it from stopping, and freeing net ports. + # Let's blindly kill them all, since we are really know what we are doing. + if [ ! -z "${%%APP_SHORTNAME%%_additional_killall}" ] + then + sleep ${%%APP_SHORTNAME%%_sleep} + killall ${%%APP_SHORTNAME%%_additional_killall} + fi + rm ${pidfile} + fi +} + +%%APP_SHORTNAME%%_status () +{ + # If running, show pid + if [ -f ${pidfile} ] + then + echo "%%APP_SHORTNAME%% is running as pid" `cat ${pidfile}` + else + echo "%%APP_SHORTNAME%% is not running" + fi +} + +run_rc_command "$1"