Skip to content
Snippets Groups Projects
Commit 0a3e7a21 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

add function dbdetect._requireProcess

parent 13dc1dc4
Branches
No related tags found
1 merge request!129Db Profiles
...@@ -31,6 +31,25 @@ function dbdetect._wd(){ ...@@ -31,6 +31,25 @@ function dbdetect._wd(){
test "$DBD_DEBUG" -ne "0" && color.echo "darkgray" "DEBUG: $*" >&2 test "$DBD_DEBUG" -ne "0" && color.echo "darkgray" "DEBUG: $*" >&2
} }
# check if a process name exisats
# param string regex to find in ps -ef output
# param bool flag to skip; default: none = abort on miss
function dbdetect._requireProcess(){
# echo "CHECK process $1"
# ps -ef | grep -v grep | grep -E "$1" >/dev/null
pgrep -l "$1" >/dev/null
rcself=$?
if [ $rcself -ne 0 ]; then
rc=$rc+$rcself
echo "INFO: missing process $1"
if [ -z "$2" ]; then
exit 4
fi
return 1
fi
return 0
}
# get a list of all config files # get a list of all config files
# param string full path of ini file # param string full path of ini file
function dbdetect.getConfigs(){ function dbdetect.getConfigs(){
...@@ -89,7 +108,7 @@ function dbdetect.exists(){ ...@@ -89,7 +108,7 @@ function dbdetect.exists(){
local binary; binary=$( ini.value "binary" ) local binary; binary=$( ini.value "binary" )
if [ -n "${binary}" ]; then if [ -n "${binary}" ]; then
for mybinary in $( echo "${binary}" | tr "," " " ); do for mybinary in $( echo "${binary}" | tr "," " " ); do
if ! j_requireBinary "$mybinary" 1 >/dev/null 2>&1; then if ! dbdetect._requireProcess "$mybinary" 1 >/dev/null 2>&1; then
dbdetect._wd "... Missing binary: ${mybinary}" dbdetect._wd "... Missing binary: ${mybinary}"
return 1 return 1
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment