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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
diff -U 3 -H -d -r -N -- neo4j-community-2.2.0-orig/bin/neo4j neo4j-community-2.2.0-mod/bin/neo4j
--- neo4j-community-2.2.0-orig/bin/neo4j 2015-03-24 09:59:49.000000000 -0300
+++ neo4j-community-2.2.0-mod/bin/neo4j 2015-03-31 10:50:57.546565829 -0300
@@ -33,23 +33,12 @@
LAUNCHD_NAME="org.neo4j.server"
function findBaseDirAndCdThere {
-# This seems to not be safe to run at any time. If that
-# is the case, it should be fixed to be so, if possible.
- SCRIPT=$0
-
- cd "`dirname "$SCRIPT"`"
- SCRIPT=`basename "$SCRIPT"`
-
- while [ -L "$SCRIPT" ]
- do
- SCRIPT=$( readlink "$SCRIPT" )
- cd "$(dirname "$SCRIPT")"
- SCRIPT=`basename "$SCRIPT"`
- done
- NEO4J_HOME=`cd $( dirname "$SCRIPT" )/.. && dirs -l +0`
- NEO4J_INSTANCE=$NEO4J_HOME
- NEO4J_CONFIG=$NEO4J_INSTANCE/conf
- NEO4J_LOG=$NEO4J_INSTANCE/data/log
+ NEO4J_HOME=/usr/share/java/neo4j
+ NEO4J_INSTANCE=/var/lib/neo4j
+ NEO4J_CONFIG=/etc/neo4j
+ NEO4J_LOG=/var/log/neo4j
+ NEO4J_SHARE=/usr/share/neo4j
+ NEO4J_RUNDIR=/run/neo4j
cd "$NEO4J_HOME"
}
@@ -67,14 +56,14 @@
}
findBaseDirAndCdThere
-source bin/utils
+source ${NEO4J_SHARE}/bin/utils
parseConfig
JAVA_OPTS="-server -XX:+DisableExplicitGC ${wrapper_java_additional}"
[ -z "${wrapper_java_initmemory}" ] || JAVA_OPTS="$JAVA_OPTS -Xms${wrapper_java_initmemory}m"
[ -z "${wrapper_java_maxmemory}" ] || JAVA_OPTS="$JAVA_OPTS -Xmx${wrapper_java_maxmemory}m"
-#NEO4J_SERVER_PORT=`( egrep "^org.neo4j.server.webserver.port" $NEO4J_INSTANCE/conf/neo4j-server.properties || echo 7474 ) | sed -e 's/.*=//'`
+#NEO4J_SERVER_PORT=`( egrep "^org.neo4j.server.webserver.port" $NEO4J_CONFIG/neo4j-server.properties || echo 7474 ) | sed -e 's/.*=//'`
NEO4J_SERVER_PORT=${org_neo4j_server_webserver_port:=7474}
LAUNCHD_NAME="${LAUNCHD_NAME}.${NEO4J_SERVER_PORT}"
@@ -90,16 +79,16 @@
# Username to propose for neo4j user, can be overridden by -u USERNAME option
DEFAULT_USER='neo4j'
-SCRIPT_NAME="${NEO4J_HOME}/bin/neo4j"
+SCRIPT_NAME="${NEO4J_SHARE}/bin/neo4j"
SERVICE_NAME=${wrapper_ntservice_name:=neo4j-service}
LAUNCHD_DIR=~/Library/LaunchAgents/
TIMEOUT=120
-PID_FILE=${NEO4J_INSTANCE}/data/neo4j-service.pid
+PID_FILE=${NEO4J_RUNDIR}/neo4j-service.pid
buildclasspath() {
# confirm library jars
- LIBDIR="$NEO4J_HOME"/lib
+ LIBDIR="$NEO4J_HOME"
if [ ! -e "$LIBDIR" ] ; then
echo "Error: missing Neo4j Library, expected at $LIBDIR"
exit 1
@@ -134,7 +123,7 @@
CLASSPATH=${ALL_JARS}
# add useful conf stuff to classpath - always a good idea
- CLASSPATH="$CLASSPATH":"$NEO4J_HOME"/conf/
+ CLASSPATH="$CLASSPATH":"$NEO4J_CONFIG"
}
detectrunning() {
@@ -144,7 +133,7 @@
else
## This could be achieved with filtering using -sTCP:LISTEN but this option is not available
## on lsof v4.78 which is the one bundled with some distros. So we have to do this grep below
- newpid=$(lsof -i :$NEO4J_SERVER_PORT -F T -Ts | grep -i "TST=LISTEN" -B1 | head -n1)
+ newpid=$(lsof -i :$NEO4J_SERVER_PORT -F p | grep "p")
newpid=${newpid:1}
fi
}
@@ -287,16 +276,16 @@
# pass in "true" for created to mark that the user was created (instead than pre-existing)
modify_user_config() {
created=${2:-"false"}
- if `grep -q "wrapper\.user=" "$NEO4J_INSTANCE/conf/neo4j-wrapper.conf"` ; then
- sed -i -e "s/^.*wrapper\.user=.*$/wrapper\.user=$1/" "$NEO4J_INSTANCE/conf/neo4j-wrapper.conf"
+ if `grep -q "wrapper\.user=" "$NEO4J_CONFIG/neo4j-wrapper.conf"` ; then
+ sed -i -e "s/^.*wrapper\.user=.*$/wrapper\.user=$1/" "$NEO4J_CONFIG/neo4j-wrapper.conf"
else
- echo "wrapper.user=$1" >> "$NEO4J_INSTANCE/conf/neo4j-wrapper.conf"
+ echo "wrapper.user=$1" >> "$NEO4J_CONFIG/neo4j-wrapper.conf"
fi
- if `grep -q "wrapper\.user\.created=" "$NEO4J_INSTANCE/conf/neo4j-wrapper.conf"` ; then
- sed -i -e "s/^.*wrapper\.user\.created=.*$/wrapper\.user\.created=${created}/" "$NEO4J_INSTANCE/conf/neo4j-wrapper.conf"
+ if `grep -q "wrapper\.user\.created=" "$NEO4J_CONFIG/neo4j-wrapper.conf"` ; then
+ sed -i -e "s/^.*wrapper\.user\.created=.*$/wrapper\.user\.created=${created}/" "$NEO4J_CONFIG/neo4j-wrapper.conf"
else
- echo "wrapper.user.created=${created}" >> "$NEO4J_INSTANCE/conf/neo4j-wrapper.conf"
+ echo "wrapper.user.created=${created}" >> "$NEO4J_CONFIG/neo4j-wrapper.conf"
fi
}
diff -U 3 -H -d -r -N -- neo4j-community-2.2.0-orig/bin/neo4j-import neo4j-community-2.2.0-mod/bin/neo4j-import
--- neo4j-community-2.2.0-orig/bin/neo4j-import 2015-03-24 09:59:49.000000000 -0300
+++ neo4j-community-2.2.0-mod/bin/neo4j-import 2015-03-31 10:51:08.903232004 -0300
@@ -86,7 +86,7 @@
if [ -z "$REPO" ]
then
- REPO="$BASEDIR"/lib
+ REPO=/usr/share/java/neo4j
fi
LIBRARY_JARS=""
diff -U 3 -H -d -r -N -- neo4j-community-2.2.0-orig/bin/neo4j-shell neo4j-community-2.2.0-mod/bin/neo4j-shell
--- neo4j-community-2.2.0-orig/bin/neo4j-shell 2015-03-24 09:59:49.000000000 -0300
+++ neo4j-community-2.2.0-mod/bin/neo4j-shell 2015-03-31 10:51:20.503231501 -0300
@@ -86,7 +86,7 @@
if [ -z "$REPO" ]
then
- REPO="$BASEDIR"/lib
+ REPO=/usr/share/java/neo4j
fi
LIBRARY_JARS=""
diff -U 3 -H -d -r -N -- neo4j-community-2.2.0-orig/bin/utils neo4j-community-2.2.0-mod/bin/utils
--- neo4j-community-2.2.0-orig/bin/utils 2015-03-24 09:59:49.000000000 -0300
+++ neo4j-community-2.2.0-mod/bin/utils 2015-03-31 10:55:24.576554252 -0300
@@ -324,11 +324,11 @@
# in place.
checkandrepairenv() {
# Create data/log if missing, change owner if created.
- if [ ! -d "$NEO4J_HOME"/data/log ]; then
- echo "${NEO4J_HOME}/data/log was missing, recreating..."
- mkdir "$NEO4J_HOME"/data/log
+ if [ ! -d "$NEO4J_LOG" ]; then
+ echo "${NEO4J_LOG} was missing, recreating..."
+ mkdir "$NEO4J_LOG"
if [ $UID == 0 ] ; then
- chown $NEO4J_USER "$NEO4J_HOME"/data/log
+ chown $NEO4J_USER "$NEO4J_LOG"
fi
fi
}
|