mirror of
https://git.freebsd.org/ports.git
synced 2025-06-26 15:10:35 -04:00
Where necessary add $FreeBSD$ to the file No PORTREVISION bump necessary because this is a no-op
54 lines
1.3 KiB
Bash
54 lines
1.3 KiB
Bash
#!/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"
|