-
-
Save rhoegg/5681446 to your computer and use it in GitHub Desktop.
RHEL init.d script for Mule ESB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# RHEL Mule Init Script | |
# | |
# chkconfig: 2345 65 64 | |
# description: Mule ESB service | |
. /etc/init.d/functions | |
# | |
if [ -f /etc/sysconfig/mule ]; then | |
. /etc/sysconfig/mule | |
fi | |
# Set JDK related environment | |
JAVA_HOME=/usr/java/default | |
PATH=$PATH:$JAVA_HOME/bin | |
# Set Mule related environment | |
MULE_HOME=/opt/mule | |
MULE_LIB=$MULE_HOME/lib | |
PATH=$PATH:$MULE_HOME/bin | |
RUN_AS_USER=mule | |
MULE_ENV=production | |
# Export environment variables | |
export JAVA_HOME MULE_HOME MULE_LIB PATH MULE_ENV RUN_AS_USER | |
case "$1" in | |
start) | |
echo "Start service mule" | |
$MULE_HOME/bin/mule start -M-Dspring.profiles.active=$MULE_ENV -M-DMULE_ENV=$MULE_ENV | |
;; | |
stop) | |
echo "Stop service mule" | |
$MULE_HOME/bin/mule stop | |
;; | |
restart) | |
echo "Restart service mule" | |
$MULE_HOME/bin/mule restart -M-Dspring.profiles.active=$MULE_ENV -M-DMULE_ENV=$MULE_ENV | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart}" | |
exit 1 | |
;; | |
esac | |
thanks for the script however watch out if you run a v < 3.6.0 https://www.mulesoft.org/jira/browse/MULE-6876
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wonder if I should move the env vars into /etc/sysconfig/mule