xinetd based services: chargen-dgram: off chargen-stream: off daytime-dgram: off daytime-stream: off discard-dgram: off discard-stream: off echo-dgram: off echo-stream: off rsync: off tcpmux-server: off time-dgram: off time-stream: off
[root@xuexi tmp]# vi /etc/xinetd.d/rsync # default: off # description: The rsync server is a good addition to an ftp server, as it \ # allows crc checksumming etc. # 定义rsync服务,名称要和/etc/xinetd.d/下的文件同名 service rsync { # yes表示不启动,no表示启动,等价于chkconfig rsync {on|off},所以这里设置后将直接在chkconfig中生效 disable = yes flags = IPv6 # 不用管 socket_type = stream # 这代表的是tcp类型的套接字 # 该服务是单线程还是多线程的,表现形式是超出的请求是否进行等待,no表示多线程 wait = no user = root # 以什么身份运行rsync server = /usr/bin/rsync # 服务程序 server_args = --daemon # 服务程序启动时传递的参数 # 连接失败的日志记录,+表示在全局对应的条目上新增此处指定的USERID log_on_failure += USERID }
service name start ==> systemctl start name.service service name stop ==> systemctl stop name.service service name restart ==> systemctl restart name.service service name status ==> systemctl status name.service
查看服务是否激活(在运行中):systemctl is-active name.service 查看所有已经激活 :systemctl list-units --type service 查看所有服务 :systemctl list-units --type service --all 设置开机自启动:chkconfig name on ==> systemctl enable name.service 禁止开机自启动:chkconfig name off ==> systemctl disable name.service 查看服务是否开机自启动:chkconfig --list name ==> systemctl is-enabled name.service 查看所有服务的开机自启动状态:chkconfig --list ==> systemctl list-unit-files --type service