Skip to content

Commit

Permalink
HZN-952: Ensure minion has stopped completely
Browse files Browse the repository at this point in the history
This uses the PID insted of the status command to ensure the minion
instance has stopped while being controlled by the init system.

> Dööp Döp Dööp Döp - Dö Dö Dööp Dööp Dööp -- Scooter
  • Loading branch information
fooker committed Nov 30, 2016
1 parent 102a5d8 commit 151fa03
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions opennms-assemblies/minion/src/main/filtered/etc/minion.init
Expand Up @@ -82,10 +82,6 @@ JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError"
# export any default configurable variables from sysconf
export JAVA_HOME JAVA_MIN_MEM JAVA_MAX_MEM MAX_FD JAVA JAVA_DEBUG_OPTS JAVA_DEBUG_PORT JAVA_OPTS CLASSPATH KARAF_DEBUG LD_LIBRARY_PATH

is_running() {
"$MINION_HOME"/bin/status >/dev/null 2>&1
}

get_root_pid() {
ROOT_INSTANCE_PID=0
if [ -f "${MINION_HOME}/instances/instance.properties" ];
Expand All @@ -95,6 +91,15 @@ get_root_pid() {
echo "$ROOT_INSTANCE_PID"
}

is_running() {
PID=$(get_root_pid)
if [ "${PID}" -ne "0" ] && ps p "$PID" > /dev/null; then
return 0
else
return 1
fi
}

stop_minion() {
"$MINION_HOME"/bin/stop >/dev/null
}
Expand Down

0 comments on commit 151fa03

Please sign in to comment.