Issue #3935 prevent warning when using init.d script to stop edex
Change-Id: I61d4ed16e76b38d69e2a71549ce31035f4837b03 Former-commit-id:d2774cffc2
[formerly b1034aa16b3393e6584038ebb80faf2a4e1a831f] Former-commit-id:6ae64007a2
This commit is contained in:
parent
bf8c0bb296
commit
53f28e0b75
1 changed files with 10 additions and 1 deletions
|
@ -64,6 +64,11 @@ getCamelAndWrapperPids() {
|
||||||
if [ "$_camel_pid" != "" ]; then
|
if [ "$_camel_pid" != "" ]; then
|
||||||
# grab wrapper pid from edex process, run throw awk to throw away leading white space
|
# 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}'`
|
_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
|
else
|
||||||
# camel not up, double check wrapper pid file
|
# camel not up, double check wrapper pid file
|
||||||
pidfile=${EDEX_INSTALL}/bin/${1}.pid
|
pidfile=${EDEX_INSTALL}/bin/${1}.pid
|
||||||
|
@ -138,7 +143,11 @@ stopEDEX() {
|
||||||
savepid=$_wrapper_pid
|
savepid=$_wrapper_pid
|
||||||
while [ "${_wrapper_pid}${_camel_pid}" != "" ]; do
|
while [ "${_wrapper_pid}${_camel_pid}" != "" ]; do
|
||||||
if [ "$_wrapper_pid" != "$savepid" ]; then
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue