From 2fdcae1046f83b024ccdcd7306164a620895eab4 Mon Sep 17 00:00:00 2001 From: Kurt Jaeger Date: Wed, 13 Mar 2019 17:08:56 +0000 Subject: New port: java/wildfly16 - also re-add files/ PR: 236464 Submitted by: Simeo Reig --- java/wildfly16/files/wildfly15.in | 98 --------------------------------------- java/wildfly16/files/wildfly16.in | 98 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 98 deletions(-) delete mode 100644 java/wildfly16/files/wildfly15.in create mode 100644 java/wildfly16/files/wildfly16.in (limited to 'java') diff --git a/java/wildfly16/files/wildfly15.in b/java/wildfly16/files/wildfly15.in deleted file mode 100644 index 04a91b637475..000000000000 --- a/java/wildfly16/files/wildfly15.in +++ /dev/null @@ -1,98 +0,0 @@ -#!/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" diff --git a/java/wildfly16/files/wildfly16.in b/java/wildfly16/files/wildfly16.in new file mode 100644 index 000000000000..04a91b637475 --- /dev/null +++ b/java/wildfly16/files/wildfly16.in @@ -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" -- cgit v1.2.3