Skip to content

Commit 95f82e7

Browse files
author
Cloud User
committed
Added systemctl command to check for tomcat service
1 parent f520915 commit 95f82e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Modular Scripts/Tomcat/configure-tomcat.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,12 @@ checkIfValidTomcatHome()
287287
eval $1="false"
288288
#check if tomcat is configured as a service. If no, then check if we have access to startup.sh file
289289
elif [ ! -f /etc/init.d/$SERVICE ]; then
290-
logMsgToConfigSysLog "INFO" "INFO: Tomcat is not configured as a service"
291-
if [ ! -f "$LOGGLY_CATALINA_HOME/bin/startup.sh" ]; then
290+
if [[ ! $(which systemctl) && $(systemctl list-unit-files $SERVICE.service | grep "$SERVICE.service") ]] &>/dev/null; then
291+
logMsgToConfigSysLog "INFO" "INFO: Tomcat is not configured as a service."
292+
if [ ! -f "$LOGGLY_CATALINA_HOME/bin/startup.sh" ]; then
292293
logMsgToConfigSysLog "WARN" "WARN: Unable to find bin/startup.sh file within $LOGGLY_CATALINA_HOME."
293294
eval $1="false"
295+
fi
294296
fi
295297
fi
296298
}

0 commit comments

Comments
 (0)