centos6.x下使用xinetd管理rsync服务

系统环境说明:centos6.x,centos7.x下rsync直接可由systemd管理(无需使用xinetd)。

[root@meinv01 ~]# rpm -qa|grep xinetd
[root@meinv01 ~]# yum clean all &>/dev/null && yum makecache &>/dev/null
[root@meinv01 ~]# yum -y install xinetd
[root@meinv01 ~]# cat /etc/xinetd.d/rsync 
# default: off
# description: The rsync server is a good addition to an ftp server, as it 
# allows crc checksumming etc.
service rsync
{
disable = yes                  #<===默认是关闭状态,需打开此功能,由xinetd管理rsync
flags = IPv6
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}
[root@meinv01 ~]# sed -i 's#yes#no#g' /etc/xinetd.d/rsync
[root@meinv01 ~]# /etc/init.d/xinetd restart            #<===重启服务
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
[root@meinv01 ~]# netstat -lntup|grep 873     #<===873端口已被xinetd管理
tcp 0 0 :::873 :::* LISTEN 2569/xinetd

这样就可以使用xinetd服务管理rsync启动和停止了(要设置开启自启动还要配置chkconfig)

其他步骤:

创建 /etc/rsyncd.conf 和创建 /etc/rsync.password,这和之前配置 rsync同步的步骤是一样的,这里不再重复!

原文地址:https://www.cnblogs.com/blog-tim/p/10724162.html