首页 > 服务器    日期:2018-08-25 / 来自互联网 / 浏览

编写脚本jdms

chmod 777 jdms

#! /bin/bash
#chkconfig: 35 85 15
#description: this is jdmsdeamon.
start() {
        echo "start jdmsdeamon: "
        /usr/local/jdms/bin/jdmsdeamon
        echo "start success"
}
 
stop() {
        echo "stop jdmsdeamon: "
        killall jdmsdeamon
        echo "stop jdms_umdeamon: "
        killall jdms_umdeamon
        echo "stop jdms_imdeamon: "
        killall jdms_imdeamon
        echo "stop success"
}
 
restart() {
        stop
        start
        echo "restart success"
}
 
case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        restart)
                restart
                ;;
        *)
                echo $"Usage: $0 {start|stop|restart}"
                exit 2
esac

保存后:chmod 777 jdms

然后:cp jdms /etc/init.d/

现在你可以使用service jdms start

然后: chkconfig –add jdms

现在是开机启动了,可以重启看看是否运行了

觉得上面的内容有用吗?快来点个赞吧!

点赞() 我要打赏

温馨提示 : 本站内容来自会员投稿以及互联网,所有源码及教程均为作者总结编辑,请大家在使用过程中提前做好备份,以免发生无法预知的错误,源码类教程请勿直接用于生产环境!

 可能感兴趣的文章