blob: 3f81ecaa456e739f9529856fe140c21b7de58f7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#!/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"
|