2016-08-19 centos 7.0 systemctl

作者: 重剑无锋_Augustine | 来源:发表于2016-08-19 14:38 被阅读65次

centos 7.0 systemctl备忘

它融合 service 和chkconfig的功能于一体。你可以使用它永久性或只在当前会话中启用/禁用服务。

systemctl start network.service 关闭网络服务:
systemctl stop network.service 重启网络服务:
systemctl restart network.service
systemctl status network.service
systemctl enable network.service 开机时启动一个服务
systemctl disable network.service 开机时禁用一个服务
systemctl is-enabled network.service 查看一个服务是否开机启动
ls /etc/systemd/system/multi-user.target.wants/ 查看开机自启动的服务

另外关于chkconfig

chkconfig --add postfix
chkconfig --del postfix
chkconfig --list
chkconfig --list httpd
chkconfig httpd on
chkconfig httpd off
chkconfig --level 35 httpd on

其中0-6分别表示:

  1. 等级0表示:表示关机
  2. 等级1表示:单用户模式
  3. 等级2表示:无网络连接的多用户命令行模式
  4. 等级3表示:有网络连接的多用户命令行模式
  5. 等级4表示:不可用
  6. 等级5表示:带图形界面的多用户模式
  7. 等级6表示:重新启动

相关文章

网友评论

    本文标题:2016-08-19 centos 7.0 systemctl

    本文链接:https://www.haomeiwen.com/subject/qcubsttx.html