Created
March 2, 2012 22:11
-
-
Save sumbach/1961745 to your computer and use it in GitHub Desktop.
Mingle init script
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
sudo mv mingle_init.sh /etc/init.d/mingle | |
sudo chown root:root /etc/init.d/mingle | |
sudo chmod 755 /etc/init.d/mingle | |
sudo update-rc.d mingle defaults 90 10 |
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 | |
# | |
# /etc/init.d/mingle | |
# | |
# chkconfig: 2345 90 10 | |
# description: Mingle web collaboration tool | |
# | |
### BEGIN INIT INFO | |
# Provides: mingle | |
# Required-Start: postgresql | |
# Required-Stop: postgresql | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: S 0 1 6 | |
# Short-Description: Mingle web collaboration tool | |
# Description: Controls ThoughtWorks Mingle via MingleServer | |
# Based on scripts on the ThoughtWorks Forums | |
# source: http://community.thoughtworks.com/posts/de8e881cfe | |
### END INIT INFO | |
MINGLE_USER=mingle | |
MINGLE_ROOT="/var/www/apps/mingle/current" | |
MINGLE_DATA_DIR="/var/www/apps/mingle/mingle-data" | |
RETVAL=0 | |
start() { | |
su - ${MINGLE_USER} -c "${MINGLE_ROOT}/MingleServer start --mingle.dataDir=${MINGLE_DATA_DIR}" | |
} | |
stop() { | |
su - ${MINGLE_USER} -c "${MINGLE_ROOT}/MingleServer stop" | |
} | |
status() { | |
su - ${MINGLE_USER} -c "${MINGLE_ROOT}/MingleServer status" | |
} | |
restart() { | |
stop | |
sleep 5 | |
start | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
status) | |
status | |
;; | |
restart) | |
restart | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|status|restart}" | |
RETVAL=1 | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment