#!/bin/sh
#
# chkconfig: 2345 80 30
# description: eyoumail is a
#
#kill -9 `ps acx | sed -n "s/ *([0-9]*) .* smsd *$/1/p"`
echo "wo yao shuijiao 300s" >> /var/log/hascript.log
start() {
date >> /var/log/hascript.log
echo "itims ha resource start. begin" >> /var/log/hascript.log
# mount /dev/sdb1 /data
df -h >> /var/log/hascript.log
if [ "$?" != "0" ]; then
exit;
fi
sleep 5
ls -l /data/mysql >> /var/log/hascript.log
find /data/mysql/ -name mysql-bin.index >> /var/log/hascript.log
chmod 777 /data/mysql -R
echo "mysql start" >> /var/log/hascript.log
# su - mysql -c mysqld >>/var/log/hascript.log 2>&1 &
nohup /data/mysql.sh & >>/var/log/hascript.log 2>&1 &
sleep 20
# mysqld --user=mysql >>/var/log/hascript.log 2>&1 &
# /usr/bin/mysqld_safe >> /var/log/hascript.log 2>&1 &
echo "itims start" >> /var/log/hascript.log
su - itims -c /data/release/startStandAloneItims1.sh >>/var/log/hascript.log 2>&1 & #这个是启动应用的
echo "itims root start" >> /var/log/hascript.log
sh /data/release/startStandAloneRoot2.sh >>/var/log/hascript.log 2>&1 & #这个是启动应用的
echo "itims ha resource start. end" >> /var/log/hascript.log
}
stop() {
date >> /var/log/hascript.log
echo "itims ha resource stop. begin" >> /var/log/hascript.log
fuser -km /data
cd /
sleep 5
umount -v /data
echo "itims ha resource stop. end" >> /var/log/hascript.log
}
case $1 in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 5
start
;;
*)
{
echo "Usage: eyoumail {start|stop|restart}";
}
;;
esac
收起