redhat 7 + systemctl验证

redhat 7 + systemctl验证

我在 redhat 7 上尝试过这个

systemctl list-unit-files --type=service|grep iptables

or

systemctl list-unit-files --type=service|grep firewall

但没有得到任何输出 - 这是否意味着 iptables/firewall 从 systemctl 中删除了?

我还看到 iptables 安装在我的 linux redhat 上

# rpm -qa |grep iptables
iptables-1.4.21-16.el7.x86_64

答案1

命令

systemctl list-unit-files --type=service|grep iptables

由于未安装 iptables-services,因此不显示 iptables!

要安装 iptables 服务需要执行

yum install iptables-services



yum install iptables-services
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can    use subscription-manager to register.
Resolving Dependencies
 --> Running transaction check
 ---> Package iptables-services.x86_64 0:1.4.21-16.el7 will be installed
 --> Finished Dependency Resolution

 Dependencies Resolved

 ================================================================================================================================================================
 Package                                     Arch                                 Version                                   Repository                            Size
================================================================================================================================================================
Installing:
iptables-services                           x86_64                              1.4.21-16.el7                             updates                            50    k

Transaction Summary
 ================================================================================    ================================================================================
 Install  1 Package

Total download size: 50 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
iptables-services-1.4.21-16.el7.x86_64.rpm                                                                                                 |  50 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : iptables-services-1.4.21-16.el7.x86_64                                                                                                         1/1
  Verifying  : iptables-services-1.4.21-16.el7.x86_64                                                                                                         1/1

Installed:
iptables-services.x86_64 0:1.4.21-16.el7

Complete!

现在 systemctl 显示它 -:)

  # systemctl list-unit-files --type=service|grep iptables
  iptables.service                       disabled

相关内容