83eb2c3700
literal name_enable wherever possible, and ${name}_enable when it's not, to prepare for the demise of set_rcvar(). In cases where I had to hand-edit unusual instances also modify formatting slightly to be more uniform (and in some cases, correct). This includes adding some $FreeBSD$ tags, and most importantly moving rcvar= to right after name= so it's clear that one is derived from the other.
45 lines
1.1 KiB
Bash
45 lines
1.1 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: geoserver
|
|
# REQUIRE: NETWORKING
|
|
#
|
|
# Add the following line to /etc/rc.conf[.local] to enable geoserver
|
|
#
|
|
# geoserver_enable (bool): Set to "NO" by default.
|
|
# Set it to "YES" to enable geoserver.
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="geoserver"
|
|
rcvar=geoserver_enable
|
|
|
|
load_rc_config ${name}
|
|
|
|
: ${geoserver_enable="NO"}
|
|
: ${geoserver_stdout_log="/var/log/geoserver_output.log"}
|
|
: ${geoserver_stderr_log="/var/log/geoserver_error.log"}
|
|
: ${geoserver_user="root"}
|
|
: ${geoserver_chdir="%%GEOSERVERDIR%%"}
|
|
: ${geoserver_pidfile="/var/run/geoserver.pid"}
|
|
|
|
java_args="-DGEOSERVER_DATA_DIR=%%GEOSERVERDIR%%/data_dir -Djava.awt.headless=true \
|
|
-DSTOP.PORT=8079 -DSTOP.KEY=geoserver -jar start.jar"
|
|
log_args=">> ${geoserver_stdout_log} 2>> ${geoserver_stderr_log}"
|
|
|
|
pidfile=${geoserver_pidfile}
|
|
command="/usr/sbin/daemon"
|
|
command_args="-p ${pidfile} %%JAVA%% ${java_args} ${geoserver_flags} ${log_args}"
|
|
procname="%%JAVA%%"
|
|
|
|
start_precmd=logs_touch
|
|
|
|
logs_touch()
|
|
{
|
|
touch $geoserver_stdout_log $geoserver_stderr_log
|
|
chown $geoserver_user $geoserver_stdout_log $geoserver_stderr_log
|
|
}
|
|
|
|
run_rc_command "$1"
|