freebsd-ports/www/webobjects/files/JavaMonitor.sh.in
Edwin Groothuis c985b7a8d6 [NEW PORTS] www/webobjects(+) Apple WebObjects ports bundle
This is a bundle of several ports covering many typical requirements
for building an Apple WebObjects deployment environment. Each port
is or has a dependancy with some other port in the bundle, and have
therefore been lodged collectively.

	www/webobjects

	WebObjects runtime is the deployment environment for Apple WebObjects
	Applications.

	WebObjects is a suite of tools and object-oriented frameworks that enable
	you to create and deploy web applications and web services using Java.

	WWW: http://www.apple.com/webobjects

PR:		ports/117299
Submitted by:	Quinton Dolan <q@onthenet.com.au>
2008-06-13 06:12:59 +00:00

53 lines
1.4 KiB
Bash

#!/bin/sh
# $FreeBSD$
# PROVIDE: JavaMonitor
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown
# Define these JavaMonitor_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
name="JavaMonitor"
JavaMonitor_enable="${JavaMonitor_enable-"NO"}"
JavaMonitor_user="${JavaMonitor_user-%%USER%%}"
JavaMonitor_flags="${JavaMonitor_flags-"-WOPort 56789"}"
JavaMonitor_pidfile="${JavaMonitor_pidfile:-/var/run/webobjects/${name}.pid}"
JavaMonitor_logfile="${JavaMonitor_logfile:-/var/log/webobjects/${name}.log}"
NEXT_ROOT="${NEXT_ROOT-%%PREFIX%%/%%NEXT_ROOT%%}"
. %%RC_SUBR%%
rcvar=`set_rcvar`
load_rc_config "$name"
load_rc_config NEXT
pidfile="${JavaMonitor_pidfile}"
logfile="${JavaMonitor_logfile}"
runuser="${JavaMonitor_user}"
procname=`basename %%JAVA%%`
log_args=">>${logfile} 2>&1 "
run_command="${NEXT_ROOT}/Library/WebObjects/JavaApplications/${name}.woa/${name}"
flags="-p ${pidfile} ${run_command} ${JavaMonitor_flags}"
command="/usr/sbin/daemon"
command_args="${log_args}"
export NEXT_ROOT=${NEXT_ROOT}
start_precmd="start_precmd"
start_precmd()
{
if [ "x${runuser}" = "xroot" ]; then
err 1 "You have to set ${name}_user to a non-root user for security reasons"
fi
touch ${pidfile} && chown ${runuser} ${pidfile}
touch ${logfile} && chown ${runuser} ${logfile}
}
run_rc_command "$1"