From f2481c2d2f96a6df4b9e2b3ffc5db5d815adcc8f Mon Sep 17 00:00:00 2001 From: Brian Clements Date: Wed, 17 Dec 2014 14:35:16 -0600 Subject: [PATCH] Issue #3935 prevent warning when using init.d script to stop edex Change-Id: I61d4ed16e76b38d69e2a71549ce31035f4837b03 Former-commit-id: 80c720eac0270f71766a7b3797fb85d81754070e [formerly 06d82c9f4edd08d8a9b5ad3dcf31bba4661eb5a3] [formerly d2774cffc27ad238562c52e52d15f39d54700274] [formerly 80c720eac0270f71766a7b3797fb85d81754070e [formerly 06d82c9f4edd08d8a9b5ad3dcf31bba4661eb5a3] [formerly d2774cffc27ad238562c52e52d15f39d54700274] [formerly 6ae64007a2259adec4d1302582f3645e60605153 [formerly d2774cffc27ad238562c52e52d15f39d54700274 [formerly b1034aa16b3393e6584038ebb80faf2a4e1a831f]]]] Former-commit-id: 6ae64007a2259adec4d1302582f3645e60605153 Former-commit-id: 4aa9120753cbb009024bd389ed27dcc286cf5ef4 [formerly 14a6f678cad9efdf01c9dcfdb58bd210efccfc9e] [formerly 6e21ec9f0b987e4baff0d440cd2b78bd4c23bf29 [formerly 53f28e0b75f7c16310388f2f3a1be74d81401fdf]] Former-commit-id: ec5ee06886fb47fbf4cb2864824b6adf3499a07f [formerly db5e0013a8826f224fa210e5f583f9f19c958ea8] Former-commit-id: 6794196b7c4d8ebbb55ecd070a6a603ba655bd44 --- .../Installer.edex/scripts/init.d/edex_camel | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rpms/awips2.edex/Installer.edex/scripts/init.d/edex_camel b/rpms/awips2.edex/Installer.edex/scripts/init.d/edex_camel index a55038350e..13f00d5d02 100644 --- a/rpms/awips2.edex/Installer.edex/scripts/init.d/edex_camel +++ b/rpms/awips2.edex/Installer.edex/scripts/init.d/edex_camel @@ -64,6 +64,11 @@ getCamelAndWrapperPids() { if [ "$_camel_pid" != "" ]; then # grab wrapper pid from edex process, run throw awk to throw away leading white space _wrapper_pid=`ps --no-headers -p $_camel_pid -o ppid | awk '{print $1}'` + # if wrapper died, camel's parent will be 1, don't report that as the wrapper + if [ "$_wrapper_pid" == "1" ] + then + _wrapper_pid="" + fi else # camel not up, double check wrapper pid file pidfile=${EDEX_INSTALL}/bin/${1}.pid @@ -138,7 +143,11 @@ stopEDEX() { savepid=$_wrapper_pid while [ "${_wrapper_pid}${_camel_pid}" != "" ]; do if [ "$_wrapper_pid" != "$savepid" ]; then - echo "WARNING: EDEX ${1} instance running under new pid, started by another user?" + # only display warning when other wrapper starts (not if wrapper died) + if [ -n "$_wrapper_pid" ] + then + echo "WARNING: EDEX ${1} instance running under new pid, started by another user?" + fi return 1 fi