Github user keith-turner commented on a diff in the pull request:
https://github.com/apache/accumulo/pull/110#discussion_r66110950
--- Diff: assemble/bin/start-daemon.sh ---
@@ -103,9 +90,61 @@ ERRFILE="${ACCUMULO_LOG_DIR}/${SERVICE}_${LOGHOST}.err"
rotate_log "$OUTFILE" ${ACCUMULO_NUM_OUT_FILES}
rotate_log "$ERRFILE" ${ACCUMULO_NUM_OUT_FILES}
-# Fork the process, store the pid
-nohup ${NUMA_CMD} "$COMMAND" "${SERVICE}" --address "${ADDRESS}"
>"$OUTFILE" 2>"$ERRFILE" < /dev/null &
-echo $! > ${PID_FILE}
+if [[ "$SERVICE" != "tserver" || $NUM_TSERVERS -eq 1 ]]; then
+ # Check the pid file to figure out if its already running.
+
PID_FILE="${ACCUMULO_PID_DIR}/accumulo-${ACCUMULO_IDENT_STRING}-${SERVICE}.pid"
+ if [ -f ${PID_FILE} ]; then
+ PID=`cat ${PID_FILE}`
+ if kill -0 $PID 2>/dev/null; then
+ # Starting an already-started service shouldn't be an error per
LSB
+ echo "$HOST : $SERVICE already running (${PID})"
+ exit 0
+ fi
+ fi
+ echo "Starting $SERVICE on $HOST"
+
+ # Fork the process, store the pid
+ nohup ${NUMA_CMD} "$COMMAND" "${SERVICE}" --address "${ADDRESS}"
>"$OUTFILE" 2>"$ERRFILE" < /dev/null &
+ echo $! > ${PID_FILE}
+
+else
+
--- End diff --
> Line 130 gives a default if its not defined.
I don't think that addresses the case I was thinking about. Thinking of
something like the following. Below the length of `TSERVER_NUMA_OPTIONS` is
not equal to `NUM_TSERVERS`, which may indicate things are not as the user
intended.
```bash
NUM_TSERVERS=3
TSERVER_NUMA_OPTIONS[1]="--cpunodebind 0"
TSERVER_NUMA_OPTIONS[2]="--cpunodebind 1"
TSERVER_NUMA_OPTIONS[2]="--cpunodebind 2" #oops I forgot to increment the
array index
```
In this case would it just take some default for instance 3?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---