Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # Startup script for the Redmine
- # chkconfig: 2355 66 33
- # processname: thin
- # pidfile: /tmp/thin.3000.pid
- # Source function library.
- . /etc/rc.d/init.d/functions
- # Source networking configuration.
- . /etc/sysconfig/network
- [ -x /usr/local/bin/thin ] || exit 0
- # See how we were called.
- case "$1" in
- start)
- echo -n "Starting Redmine: "
- export RAILS_ENV=production
- daemon /usr/local/bin/thin -C /etc/thin/redmine start
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/redmine
- ;;
- stop)
- echo -n "Stopping Redmine: "
- kill -9 `cat /tmp/thin.0.pid`
- kill -9 `cat /tmp/thin.1.pid`
- kill -9 `cat /tmp/thin.2.pid`
- rm -f /tmp/thin.0.pid
- rm -f /tmp/thin.1.pid
- rm -f /tmp/thin.2.pid
- RETVAL=$?
- echo
- ### heres the fix... we gotta remove the stale files on restart
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/redmine
- ;;
- status)
- status redmine
- RETVAL=$?
- ;;
- restart)
- $0 stop
- $0 start
- RETVAL=$?
- ;;
- *)
- echo "Usage: redmine {start|stop|status|restart}"
- exit 1
- esac
- exit $RETVAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement