diff options
Diffstat (limited to 'tomcat-7.0-tomcat-sysd')
-rw-r--r-- | tomcat-7.0-tomcat-sysd | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tomcat-7.0-tomcat-sysd b/tomcat-7.0-tomcat-sysd index 1e79816..af3ed17 100644 --- a/tomcat-7.0-tomcat-sysd +++ b/tomcat-7.0-tomcat-sysd @@ -72,6 +72,12 @@ function start() { chown ${TOMCAT_USER}:${TOMCAT_USER} $TOMCAT_LOG fi + # if jsvc installed and USE_JSVC=true + # then start as root and use jsvc to drop privileges + if [ -x /usr/bin/jsvc ] && [ "$USE_JSVC" = "true" ]; then + TOMCAT_USER="root" + fi + parseOptions if [ "$SECURITY_MANAGER" = "true" ]; then $SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} start-security" >> $TOMCAT_LOG 2>&1 @@ -81,6 +87,12 @@ function start() { } function stop() { + # if jsvc installed and USE_JSVC=true + # then start as root and use jsvc to drop privileges + if [ -x /usr/bin/jsvc ] && [ "$USE_JSVC" = "true" ]; then + TOMCAT_USER="root" + fi + parseOptions $SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} stop" >> $TOMCAT_LOG 2>&1 } |