Lines 12-18
Link Here
|
12 |
# Add the following line to /etc/rc.conf to enable `unifi': |
12 |
# Add the following line to /etc/rc.conf to enable `unifi': |
13 |
# |
13 |
# |
14 |
# unifi_enable="YES" |
14 |
# unifi_enable="YES" |
|
|
15 |
# |
16 |
# Other configuration settings for unifi that can be set in /etc/rc.conf: |
17 |
# |
18 |
# unifi_user (str) |
19 |
# This is the user that unifi runs as |
20 |
# Set to %%USERS%% by default |
21 |
# |
22 |
# unifi_group (str) |
23 |
# This is the group that unifi runs as |
24 |
# Set to %%GROUPS%% by default |
25 |
# |
26 |
# unifi_chdir (str) |
27 |
# This is the directory that unifi chdirs into before starting |
28 |
# Set to %%JAVASHAREDIR%%/unifi by default |
29 |
# |
30 |
# unifi_java_home (str) |
31 |
# The path to the base directory for the Java to use to run unifi |
32 |
# Defaults to %%JAVA_HOME%% |
33 |
# |
34 |
# unifi_javaflags (str) |
35 |
# Flags passed to Java to run unifi |
36 |
# Set to "-Djava.awt.headless=true -Xmx1024M" by default |
37 |
# |
15 |
|
38 |
|
|
|
39 |
|
16 |
. /etc/rc.subr |
40 |
. /etc/rc.subr |
17 |
name=unifi |
41 |
name=unifi |
18 |
|
42 |
|
Lines 23-34
Link Here
|
23 |
: ${unifi_user:=%%USERS%%} |
47 |
: ${unifi_user:=%%USERS%%} |
24 |
: ${unifi_group:=%%GROUPS%%} |
48 |
: ${unifi_group:=%%GROUPS%%} |
25 |
: ${unifi_chdir=%%JAVASHAREDIR%%/unifi} |
49 |
: ${unifi_chdir=%%JAVASHAREDIR%%/unifi} |
|
|
50 |
: ${unifi_java_home=%%JAVA_HOME%%} |
26 |
: ${unifi_javaflags:="-Djava.awt.headless=true -Xmx1024M"} |
51 |
: ${unifi_javaflags:="-Djava.awt.headless=true -Xmx1024M"} |
27 |
|
52 |
|
28 |
pidfile="/var/run/unifi/${name}.pid" |
53 |
pidfile="/var/run/unifi/${name}.pid" |
29 |
procname=%%JAVA%% |
54 |
procname=${unifi_java_home}/bin/java |
30 |
command="/usr/sbin/daemon" |
55 |
command="/usr/sbin/daemon" |
31 |
command_args="-f -p ${pidfile} %%JAVA%% ${unifi_javaflags} -jar lib/ace.jar start" |
56 |
classpath=`echo ${unifi_chdir}/lib/*.jar | sed -e 's/ /:/g'` |
|
|
57 |
command_args="-f -p ${pidfile} ${unifi_java_home}/bin/java ${unifi_javaflags} -cp ${classpath} com.ubnt.ace.Launcher start" |
32 |
start_precmd=start_precmd |
58 |
start_precmd=start_precmd |
33 |
stop_precmd=stop_precmd |
59 |
stop_precmd=stop_precmd |
34 |
stop_postcmd=stop_postcmd |
60 |
stop_postcmd=stop_postcmd |