Centos7 进程管理 - 防火墙
2019-04-25 23:46
225 查看
1、特殊说明
-
在CentOS 7中改用了
systemctl
服务器命令,实际上是由 service(即时生效,重启后失效) 和 chkconfig(当前不生效,重启生效) 组成。详见下图 (序号表示不同实现方式)任务 CentOS7之前 CentOS7 用于启动服务 service frobozz start systemctl start frobozz 用于停止服务 service frobozz stop systemctl stop frobozz 用于重新启动服务 service frobozz restart systemctl restart frobozz 在不中断挂起操作的情况下重新加载配置文件。 service frobozz reload systemctl reload frobozz 如果服务已经在运行,则重新启动。 service frobozz condrestart systemctl condrestart frobozz 服务当前状态。 service frobozz status systemctl status frobozz 用于列出可以启动或停止的服务。用于列出所有服务和其他单位 ls /etc/rc.d/init.d/ ① systemctl ② systemctl list-unit-files --type=service 打开服务,以便在下一次启动时启动,或启动其他触发器。 chkconfig frobozz on systemctl enable frobozz 为下一次重新启动或任何其他触发器关闭服务。 chkconfig frobozz off systemctl disable frobozz 用于检查服务是否配置为在当前环境中启动。 chkconfig frobozz systemctl is-enabled frobozz 打印一个服务表,该表列出每个运行级别上或关闭配置的运行级别。 chkconfig --list ① systemctl list-unit-files --type=service ② ls /etc/systemd/system/*.wants/ 打印在启动到图形模式时将启动的服务表。 chkconfig --list | grep 5:on systemctl list-dependencies graphical.target 用于列出此服务在或关闭时配置的级别。 chkconfig frobozz --list ls /etc/systemd/system/*.wants/frobozz.service 在创建新服务文件或修改任何配置时使用。 chkconfig frobozz --add systemctl daemon-reload
2、防火墙服务 (这里使用CentOS 7.0)
- 查看防火墙当前状态
- 关闭防火墙
- 重启防火墙
- 查看防火墙开放端口号
- 开启端口 ( 开启端口号后必须重新载入,命令:
firewall-cmd --reload
)
命令含义:--zone //作用域
--add-port=80/tcp //添加端口,格式为:端口/通讯协议
--permanent //永久生效,没有此参数重启后失效
3、运行级别
init级别 | 描述 | systemctl target |
---|---|---|
0 | 系统停机状态,系统默认运行级别不能设为0,否则不能正常启动 | shutdown.target |
1 | 单用户工作状态,root权限,用于系统维护,禁止远程登陆 | emergency.target |
2 | 多用户状态(没有NFS),不支持网络 | rescure.target |
3 | 多用户状态(有NFS),登陆后进入命令行模式 | multi-user.target |
4 | 系统未使用,保留 | 无 |
5 | 图形界面 | graphical.target |
6 | 系统正常关闭并重新启动,默认运行级别不能设为6,否则不能正常启动 | 无 |
4、其他常用指令
- 查看服务
- 开启服务 (重启生效)
- 查看在启动到图形模式时将启动的服务表
相关文章推荐
- Ubuntu/CentOS使用Supervisor管理进程
- CentOS 安装 supervisor 进程管理工具
- centos7 Supervisor的安装与配置,管理elk进程。
- CentOS 中安装htop进程管理监控工具
- Centos7 进程管理 - 动态监控进程
- Centos平台使用 Supervisord 管理后台进程
- 实战CentOS 6.3安装配置supervisor进程管理工具
- CentOS进程管理
- CentOS 下管理自定义 PHP 计划任务代码的守护进程脚本
- 09.05 CentOS 6.5中安装htop进程管理监控工具
- CentOS7 日常管理--抓包工具、防火墙及计划任务
- 初学CentOS——进程管理基本命令
- centos7防火墙firewalld守护进程
- Linux进程端口,防火墙端口管理
- 【htop】Linux CentOS 6.5下安装htop进程管理工具
- Centos进程作业管理与计划任务(一)
- centos6.4 防火墙管理
- centos6.5中安装htop进程管理监控工具
- CentOS7下使用rmcli配置IP地址详解及网络连接状态查看工具和进程管理工具的使用
- 17101101_CentOS7进程管理systemd详解