-
-
Save chy168/6826643 to your computer and use it in GitHub Desktop.
Mule init script.
puppet can detect status to ensure service status.
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 | |
# Modify from: https://gist.github.com/rhoegg/5681446 | |
# 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=/etc/alternatives/jre | |
PATH=$PATH:$JAVA_HOME/bin | |
# Set Mule related environment | |
MULE_HOME=/usr/share/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 | |
export JAVA_HOME MULE_HOME PATH | |
case "$1" in | |
start) | |
echo "Start service mule" | |
$MULE_HOME/bin/mule start | |
;; | |
stop) | |
echo "Stop service mule" | |
$MULE_HOME/bin/mule stop | |
;; | |
restart) | |
echo "Restart service mule" | |
$MULE_HOME/bin/mule restart | |
;; | |
status) | |
$MULE_HOME/bin/mule status | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart}" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment