2012년 5월 27일 일요일
❑ MySQLProxy 자동 시작 스크립트
#!/bin/sh
# chkconfig: - 85 15
# description: MySQL Proxy Server
PROXY_ROOT=/database/mysql-proxy
PROG=mysql-proxy
PID_FILE=$PROXY_ROOT/MySQLProxy.pid
LOCK_FILE=/var/lock/subsys/MySQLProxy
OPTIONS="--defaults-file=/etc/mysql-proxy.cnf"
. /etc/init.d/functions
RETVAL=0
start()
{
if [ -f $LOCK_FILE ]; then
echo -n $"MySQLProxy is running now."
RETVAL=$?
echo
else
echo -n $"Starting MySQLProxy"
daemon $PROXY_ROOT/bin/$PROG $OPTIONS && touch $LOCK_FILE
RETVAL=$?
echo
fi
}
stop()
{
if [ -f $LOCK_FILE ]; then
echo -n $"Shutting down MySQLProxy"
killproc $PROG
RETVAL=$?
if [ "$RETVAL"="0" ]; then
rm -rf $LOCK_FILE
fi
echo
else
echo -n $"MySQLProxy is not running."
RETVAL=$?
echo
fi
}
restart()
{
stop
sleep 3
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status $PROG
;;
*)
echo "Usage : $0 {start|stop|restart|status}"
exit 1
esac
exit $RETVAL
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기