centos7中systemctl 对系统服务的控制
· 技术积累 · Centos7

这里以iptables服务为例说明,systemctl和cenots6 service 是相同的

centos7上还是可以用service 这个命令的,比如一些源码包安装后的启动服务脚本


安装service命令
yum install initscripts

启动服务
systemctl start iptables.service

停止服务
systemctl stop iptables.service

重启服务
systemctl restart iptables.service

查看服务状态
systemctl status iptables.service

开机启动
systemctl enable iptables.service 

禁止开机启动
systemctl disable iptables.service

查看所有已启动的服务
systemctl list-units --type=service

查看开机启动服务列表
systemctl list-unit-files

查看某个服务开机是否启动
systemctl list-unit-files |grep iptables
iptables.service                       enabled 

本文最后更新时间 2023-04-02
文章链接地址:
https://me.jinchuang.org/archives/88.html
本站文章除注明[转载|引用],均为本站原创内容,转载前请注明出处
yum安装出现error: %pre() scriptlet failed, exit status 1, Error in PREIN scriptlet in rpm package 错误
Centos7 使用strongSwan搭建IKEv2
在Nginx中配置使用Geoip2模块
pip 安装错误 Command "python setup.py egg_info" failed with error code

gitlab+jenkins使用构建打包

centos 配置sudo记录日志

留言列表

  1. Awking
    Windows 10 Google Chrome
    中国上海市电信

    你贼6!

我要留言