系统集成系统维护

请高手帮忙查看一下这个脚本

#!/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.logstart() {     date >> /var/log/hascript.log ...显示全部
#!/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收起
参与9

查看其它 7 个回答zxcv12000的回答

zxcv12000zxcv12000系统运维工程师东华合创
回复 2# wcxhs

这个脚本 单跑 完全没有问题,套在 双机资源包里 mysql就起不来
系统集成 · 2014-11-28
浏览1525

回答者

zxcv12000
系统运维工程师东华合创
擅长领域: 服务器AIXUnix

zxcv12000 最近回答过的问题

回答状态

  • 发布时间:2014-11-28
  • 关注会员:1 人
  • 回答浏览:1525
  • X社区推广