-
服务启动脚本模板
- #!/bin/bash
- # chkconfig: 345 99 99
- # description: this is a testsrv
- . /etc/init.d/functions
- lockfile=/var/lock/subsys/$0
- start(){
- if [ -e $lockfile ] ; then
- action "$0 is running"
- else
- touch $lockfile
- if [ "$?" -eq 0 ] ; then
- action "$0 start"
- else
- action "$0 failed" false
- fi
- fi
- }
- stop(){
- if [ -e $lockfile ] ; then
- rm -rf $lockfile
- if [ "$?" -eq 0 ] ; then
- action "$0 stop"
- else
- action "$0 stop failed" false
- fi
- else
- action "$0 is stoped"
- fi
- }
- restart(){
- start
- stop
- }
- status(){
- if [ -e $lockfile ] ; then
- action "$0 running"
- else
- action "$0 stoped"
- fi
- }
- usage(){
- echo "$0 {start|stop|status|restart}"
- }
- case $1 in
- start)
- start;;
- stop)
- stop;;
- restart)
- restart;;
- status)
- status;;
- *)
-
相关阅读:
Java-->实现断点续传(下载)
Java-->分割文件
Java-->IO流模拟实现用户登录以及登录信息
Java-->PrintStream
Java-->一个只能运行十次的程序
MySQL之数据类型
【linux相识相知】网络属性配置
MySQL之基本语句
【linux相识相知】sed命令
【Linux相识相知】yum的配置使用和程序包的编译安装
-
原文地址:https://www.cnblogs.com/momenglin/p/8483269.html
Copyright © 2020-2023
润新知