IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    systemctl

    admin发表于 2015-06-29 01:27:18
    love 0
    systemctl命令是系统服务管理器指令,它实际上将service和chkconfig这两个命令组合到一起。任务旧指令新指令使某服务自动启动chkconfig --level 3httpdonsystemctlenablehttpd.service使某服务不自动启动chkconfig --level 3 httpd offsystemctl disable httpd.service检查服务状态service httpd statussystemctl status httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active)显示所有已启动的服务chkconfig --listsystemctl list-units --type=service启动某服务service httpd startsystemctl start httpd.service停止某服务service httpd stopsystemctl stop httpd.service重启某服务service httpd restartsystemctl restart httpd.service实例1.启动nfs服务systemctl start nfs-server.service2.设置开机自启动systemctl enable nfs-server.service3.停止开机自启动systemctl disable nfs-server.service4.查看服务当前状态systemctl status nfs-server.service5.重新启动某服务systemctl restart nfs-server.service6.查看所有已启动的服务systemctl list -units --type=service开启防火墙22端口iptables -I INPUT -p tcp --dport 22 -j accept如果仍然有问题,就可能是SELinux导致的关闭SElinux:修改/etc/selinux/config文件中的SELINUX=””为disabled,然后重启。彻底关闭防火墙:sudo systemctl status firewalld.service sudo systemctl stop firewalld.service sudo systemctl disable firewalld.service


沪ICP备19023445号-2号
友情链接