DoubleLi

qq: 517712484 wx: ldbgliet

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

举个栗子:idea的注册服务
位置及文件:/etc/init.d/idea
idea

#!/bin/sh
# chkconfig: 2345 80 90
# description: idea register server

case "$1" in
        start)
                sh /usr/local/idea/start.sh
        ;;
        stop)
                ps -ef |grep idea|grep -v grep|awk '{print $2}'|xargs kill
        ;;
esac

# chkconfig ,# description不要少,设置自启需要。

服务启动:service idea start
服务关闭:service idea shutdown
设置自启:chkconfig idea on
关闭自启:chkconfig idea off

 

posted on 2020-11-18 16:26  DoubleLi  阅读(722)  评论(0编辑  收藏  举报