aboutsummaryrefslogtreecommitdiff
path: root/www/webobjects/files/wotaskd.in
diff options
context:
space:
mode:
Diffstat (limited to 'www/webobjects/files/wotaskd.in')
-rw-r--r--www/webobjects/files/wotaskd.in54
1 files changed, 54 insertions, 0 deletions
diff --git a/www/webobjects/files/wotaskd.in b/www/webobjects/files/wotaskd.in
new file mode 100644
index 000000000000..e6afe23937b8
--- /dev/null
+++ b/www/webobjects/files/wotaskd.in
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: wotaskd
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+#
+# Define these wotaskd_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+
+. /etc/rc.subr
+
+name="wotaskd"
+rcvar=wotaskd_enable
+
+load_rc_config "$name"
+load_rc_config NEXT
+
+wotaskd_enable="${wotaskd_enable-"NO"}"
+wotaskd_user="${wotaskd_user-%%USER%%}"
+wotaskd_pidfile="${wotaskd_pidfile:-/var/run/webobjects/${name}.pid}"
+wotaskd_logfile="${wotaskd_logfile:-/var/log/webobjects/${name}.log}"
+NEXT_ROOT="${NEXT_ROOT-%%PREFIX%%/%%NEXT_ROOT%%}"
+
+pidfile="${wotaskd_pidfile}"
+logfile="${wotaskd_logfile}"
+runuser="${wotaskd_user}"
+
+procname=`basename %%JAVA%%`
+log_args=">>${logfile} 2>&1 "
+run_command="${NEXT_ROOT}/Library/WebObjects/JavaApplications/${name}.woa/${name}"
+flags="-p ${pidfile} ${run_command} ${wotaskd_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"