linux基础(35)--服务管理--RHEL7
2016-06-06 14:43
281 查看
1. systemd简介
RHEL6中使用systemv对服务进行管理,主要的管理工具是service。
RHEL7中使用systemd对服务进行管理,主要的管理工具是systemctl
systemd特性:
(1)降低对服务脚本的依赖性
(2)可以自动处理服务之间的依赖性,REHL6中服务之间的依赖性需要自己进行处理。
依赖处理:软件之间的依赖:yum,服务之间的依赖:systemd,模块之间的依赖:modprobe
RHEL6中服务的管理脚本在/etc/init.d/下,RHEL7服务启动文件在/usr/lib/systemd/system中。
systemctl融合了REHL6的service和chkconfig的功能。
2. 服务管理
以下以sshd服务为例说明RHEL7的服务管理
查看服务状态:
systemctl status sshd
开启服务:
systemctl start sshd
关闭服务:
systemctl stop sshd
重启服务:
systemctl restart sshd
服务开机启动:
systemctl enable sshd
服务开机不启动:
systemctl disable sshd
查看服务是否开机启动:
systemctl is-enabled sshd
查看所有服务的状态:
systemctl list-unit-files
锁定服务:
systemctl mask sshd #此时这个服务不可以进行操作
解除服务的锁定:
systemctl unmask sshd
列出服务间的依赖关系:
systemctl list-dependencies
3. 防火墙服务
firewalld
systemctl start/stop/restart firewalld
为http服务添加防火墙规则:
firewall-cmd --permanent --add-service=http
使配置生效:
firewall-cmd --reload
图形化配置防火墙:
firewall-config
RHEL6中使用systemv对服务进行管理,主要的管理工具是service。
RHEL7中使用systemd对服务进行管理,主要的管理工具是systemctl
systemd特性:
(1)降低对服务脚本的依赖性
(2)可以自动处理服务之间的依赖性,REHL6中服务之间的依赖性需要自己进行处理。
依赖处理:软件之间的依赖:yum,服务之间的依赖:systemd,模块之间的依赖:modprobe
RHEL6中服务的管理脚本在/etc/init.d/下,RHEL7服务启动文件在/usr/lib/systemd/system中。
systemctl融合了REHL6的service和chkconfig的功能。
2. 服务管理
以下以sshd服务为例说明RHEL7的服务管理
查看服务状态:
systemctl status sshd
开启服务:
systemctl start sshd
关闭服务:
systemctl stop sshd
重启服务:
systemctl restart sshd
服务开机启动:
systemctl enable sshd
服务开机不启动:
systemctl disable sshd
查看服务是否开机启动:
systemctl is-enabled sshd
查看所有服务的状态:
systemctl list-unit-files
锁定服务:
systemctl mask sshd #此时这个服务不可以进行操作
解除服务的锁定:
systemctl unmask sshd
列出服务间的依赖关系:
systemctl list-dependencies
3. 防火墙服务
firewalld
systemctl start/stop/restart firewalld
为http服务添加防火墙规则:
firewall-cmd --permanent --add-service=http
使配置生效:
firewall-cmd --reload
图形化配置防火墙:
firewall-config
相关文章推荐
- Linux命令行下编辑文档
- Linux Rootkit 系列二:基于修改 sys_call_table 的系统调用挂钩
- Linux下vim打不开
- Linux堆内存管理深入分析--阿里聚安全
- Linux堆溢出漏洞利用之unlink
- linux基础(34)--REHL7基本配置--RHEL7
- Centos 7 之 systemctl
- arm linux下使用 qextserialport 编写串口小程序
- linux fd dup 使用
- Linux 下系统调用的三种方法
- linux运维中,如何打印进程消耗内存占比(排序)
- 用crontab命令实现每天定时的病毒扫描
- linux echo命令的-n、-e两个参数
- Linux软连接和硬链接
- linux修改open files数
- linux基础(33)--正则表达式--RHEL6.5
- 《Linux内核分析》-----张超
- centos 6.X 安装node
- windows下python连接linux的mysql并且使用
- Linux系统基础网络配置老鸟精华篇