blob: a7f9e6f83cd789a02870474c05e19ef55e21a1bf (
plain) (
blame)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#!/bin/sh
# PROVIDE: neo4j
# REQUIRE: DAEMON
# KEYWORD: shutdown
# Add the following line to /etc/rc.conf to enable neo4j:
#
# neo4j_enable=YES
#
# The following rc.conf variable can be set:
#
# For user/group to run neo4j under:
#
# neo4j_user (str) Default: neo4j
# neo4j_group (str) Default: neo4j
#
# For service jail:
#
# neo4j_svcj_options (str) Default: net_basic
#
. /etc/rc.subr
name=neo4j
rcvar=neo4j_enable
desc="Graphing database"
load_rc_config $name
: ${neo4j_enable:=NO}
: ${neo4j_user=neo4j}
: ${neo4j_group=neo4j}
: ${neo4j_svcj_options:=net_basic}
: ${neo4j_env:="HOME=%%DBDIR%% NEO4J_CONF=%%ETCDIR%% JAVA_HOME=%%JAVA_HOME%%"}
command=%%PREFIX%%/bin/neo4j
procname=%%JAVA_HOME%%/bin/java
start_cmd="su -m $neo4j_user -c \"$command start\""
start_precmd=neo4j_prestart
stop_cmd="su -m $neo4j_user -c \"$command stop\""
status_cmd="su -m $neo4j_user -c \"$command status\""
neo4j_prestart()
{
NEO4J_DATA=%%DBDIR%%/data
NEO4J_METRICS=%%DBDIR%%/metrics
NEO4J_LIB=%%PREFIX%%/neo4j/lib
NEO4J_LOGS=%%LOGDIR%%
NEO4J_PLUGINS=${NEO4J_LIB}/plugins
NEO4J_RUN=%%RUNDIR%%
[ -d ${NEO4J_LOGS} ] || install -d -o ${neo4j_user} -g ${neo4j_group} -m 0750 ${NEO4J_LOGS}
[ -d ${NEO4J_RUN} ] || install -d -o ${neo4j_user} -g ${neo4j_group} ${NEO4J_RUN}
[ -d ${NEO4J_DATA} ] || install -d -o ${neo4j_user} -g ${neo4j_group} -m 0750 ${NEO4J_DATA}
[ -d ${NEO4J_METRICS} ] || install -d -o ${neo4j_user} -g ${neo4j_group} -m 0750 ${NEO4J_METRICS}
}
run_rc_command $1
|