#!/bin/bash
##############################################################
# File Name: -.sh
# Version: V1.
# Author: guojintao
# Organization: https://www.cnblogs.com/guojintao/
# Created Time : -- ::
# Description:
##############################################################
. /etc/init.d/functions
RETVAL=
prog="rsyncd"
rsyncd=/usr/bin/rsync
pid_file=/var/run/rsyncd.pid
lockfile=/var/lock/subsys/$prog
conf_file=/etc/rsyncd.conf if [ -f $conf_file ];then
grep "pid file=$pid_file" $conf_file |grep -v "^#" >/dev/null || {
action "pid file undefined in $conf_file" /bin/false
exit
}
else
action "$conf_file not exist" /bin/false
exit
fi
start(){
echo -n $"Starting $prog: "
rsync --daemon && success || failure
RETVAL=$?
[ $RETVAL -eq ] && touch $lockfile
echo
return $RETVAL
}
stop(){
echo -n $"Stopping $prog: "
killproc -p $pid_file $rsyncd
RETVAL=$?
[ $RETVAL -eq ] && rm -f $lockfile
echo
}
rh_status() {
status -p $pid_file rsyncd
}
rh_status_q() {
rh_status >/dev/null >&
}
case "$1" in
"start")
rh_status_q && exit
start
;;
"stop")
if ! rh_status_q; then
rm -f $lockfile
exit
fi
stop
;;
"status")
rh_status
RETVAL=$?
if [ $RETVAL -eq -a -f $lockfile ] ; then
RETVAL=
fi
;;
"restart")
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
RETVAL=
esac
exit $RETVAL

rsyncd启动脚本的更多相关文章

  1. rsync随机启动脚本

    服务端 #!/bin/sh # chkconfig: # description: Saves and restores system entropy pool for \ #create by xi ...

  2. 开发rsync启动脚本2

    使用函数更加规范的开发rsync启动脚本 #!/bin/bash #chkconfig: #description: create by vincen . /etc/init.d/functions ...

  3. rsync启动脚本

    rsync启动脚本 01 #!/bin/bash  www.ahlinux.com 02 # 03 # rsyncd      This shell script takes care of star ...

  4. logstash服务启动脚本

    logstash服务启动脚本 最近在弄ELK,发现logstash没有sysv类型的服务启动脚本,于是按照网上一个老外提供的模板自己进行修改 #添加用户 useradd logstash -M -s ...

  5. 改进uwsgi启动脚本,使其支持多个独立配置文件

    最近在研究flask,在架设运行环境的时候犯了难.因为我想把每个独立的应用像NGINX处理多个网站那样,每个应用单独一个配置文件.而网上流传的uwsgi启动脚本都只支持单个配置文件.虽然有文章说可以把 ...

  6. linux nginx 启动脚本

    linux nginx 启动脚本 [root@webtest76 ~]# vi /etc/init.d/nginx #!/bin/bash # nginx Startup script for the ...

  7. busybox rootfs 启动脚本分析(二)

    上次分析了busybox的启动脚本,这次分析一下init.d中一些脚本的内容. 参考链接 http://www.cnblogs.com/helloworldtoyou/p/6169678.html h ...

  8. Tomcat启动脚本

    记录一个比较好的tomcat启动脚本,截取<OneinStack>,修改如下两个参数即可用. 使用之前修改下面2个参数: #Location of JAVA_HOME (bin files ...

  9. Linux Runlevel 启动 脚本

    Linux 操作系统自从开始启动至启动完毕需要经历几个不同的阶段,这几个阶段就叫做 Runlevel,同样,当Linux操作系统关闭时也要经历另外几个不同的 Runlevel,下面详细介绍一下 Run ...

随机推荐

  1. 云计算openstack共享组件(1)——时间同步服务ntp

    一.标准时间讲解 地球分为东西十二个区域,共计 24 个时区 格林威治作为全球标准时间即 (GMT 时间 ),东时区以格林威治时区进行加,而西时区则为减. 地球的轨道并非正圆,在加上自转速度逐年递减, ...

  2. 最新:百度春节抢百万游戏--汤圆向前冲--辅助工具v1.0.0.2

    https://www.cnblogs.com/Charltsing/p/ADBJumpTY.html 联系QQ:564955427 本程序为Windows版,不要在手机里面打开. 汤圆向前冲辅助工具 ...

  3. Photoshop给草坡上的人物加上大气的霞光

    <点小图查看大图> 最终效果 1.打开原图素材大图,创建可选颜色调整图层,对红色.黄色.黑色进行调整,参数设置如图1 - 3,效果如图4.这一步减少图片中的红色,并给暗部增加蓝色. < ...

  4. VS + QT 出现 LNK2001 无法解析的外部符号 QMetaObject 的问题

    在一个QT项目中新建一个带QObject定义的类后 (不是继承),可能会出现LNK2001 的错误,这是由于IDE没有自动为新建的类生成 moc_XXXX.cpp 文件导致的. 一种做法是手动生成mo ...

  5. Git操作记录

    记录一些用过的操作 增加远程推送分支 git remote add orgin http://xxxxx.git 直接新建本地分支,将远程分支提取出来. git checkout -t origin/ ...

  6. 微信支付之02------整个微信支付功能----------Java实现

    先来看下微信支付官方文档: 1.在官方文档上有很多种支付方式,由于目前我只做过JSAPI和微信扫码支付二种,其他的就不说了. >>>>>第一种微信扫码支付>> ...

  7. this.setData , that.setData , this.data.val三者之间的区别和作用

    1.this.setData({ }) <view bindtouchmove="tap_drag" bindtouchend="tap_end" bin ...

  8. Java 写 Log

    . 一个最基本的例子 使用Logging框架写Log基本上就三个步骤 引入loggerg类和logger工厂类 声明logger 记录日志 下面看一个例子 //1. 引入slf4j接口的Logger和 ...

  9. ionic3隐藏子页面的tabs和配置返回按钮

    在app.modlues.ts文件中修改 imports: [ BrowserModule, IonicModule.forRoot(MyApp, { tabsHideOnSubPages: 'tru ...

  10. bat脚本基本命令和格式

    bat脚本 --莫非 BAT脚本与shell脚本区别 Shell脚本使用Linux/Unix下的命令,一般文件开头以#号来告诉系统这个脚本需要什么解释器来执行(如:#!/bin/bash采用bash而 ...