diff options
author | Juraj Lutter <otis@FreeBSD.org> | 2025-05-25 15:53:13 +0200 |
---|---|---|
committer | Juraj Lutter <otis@FreeBSD.org> | 2025-05-25 16:53:35 +0200 |
commit | 882cb317da85522cbf2462ec264ff07112e58309 (patch) | |
tree | 2c071182ecb2e3108f613af591a7e9406951e8a1 /databases/neo4j/files/neo4j.in | |
parent | sysutils/tailspin: update to 5.4.3 (diff) |
databases/neo4j: Fix run-time
- Assign UID and GIT to neo4j (both 369)
- Instruct neo4j to run as neo4j user
- Move config directory to PREFIX/etc/neo4j
- Move certificates base directory to PREFIX/etc/neo4j/certificates
- Move data directory to /var/db/neo4j/data
- Move metrics directory to /var/db/neo4j/metrics
- Move import directory to /var/db/neo4j/import
- Fix rc.d script accordingly
Partially based on information from [1] and [2]
PR: 268526 [1]
PR: 228532 [2]
Sponsored by: resulta.sk
Diffstat (limited to 'databases/neo4j/files/neo4j.in')
-rw-r--r-- | databases/neo4j/files/neo4j.in | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/databases/neo4j/files/neo4j.in b/databases/neo4j/files/neo4j.in index 6cb20b01c3ea..a7f9e6f83cd7 100644 --- a/databases/neo4j/files/neo4j.in +++ b/databases/neo4j/files/neo4j.in @@ -7,6 +7,18 @@ # 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 @@ -17,21 +29,30 @@ 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 -start_cmd="$command start" +procname=%%JAVA_HOME%%/bin/java +start_cmd="su -m $neo4j_user -c \"$command start\"" start_precmd=neo4j_prestart -stop_cmd="$command stop" -status_cmd="$command status" +stop_cmd="su -m $neo4j_user -c \"$command stop\"" +status_cmd="su -m $neo4j_user -c \"$command status\"" neo4j_prestart() { - NEO4J_DATA=%%DBDIR%% + NEO4J_DATA=%%DBDIR%%/data + NEO4J_METRICS=%%DBDIR%%/metrics NEO4J_LIB=%%PREFIX%%/neo4j/lib NEO4J_LOGS=%%LOGDIR%% NEO4J_PLUGINS=${NEO4J_LIB}/plugins NEO4J_RUN=%%RUNDIR%% - mkdir -p ${NEO4J_LOGS} ${NEO4J_RUN} + [ -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 |