zoukankan      html  css  js  c++  java
  • Centos-服务管理-systemctl

    systemctl命令属于systemd软件包,这个软件包不仅可以完成系统的初始化工作,还能对系统和服务进行管理

    在centos7中,服务单元取代启动脚本,服务单元以.service为文件扩展名,配置文件为 /etc/systemd,相当于Centos7版本前的service chkconfig命令组合

    # namd.service 表示各服务的服务单元

    服务管理

      1. 启动服务                  start

    systemctl start named.service

      2. 停止服务                  stop

    systemctl stop named.service

      3. 如果服务未运行则启动,服务运行则重启    restart

    systemctl restart named.service

      4. 只有在服务运行态时候才能重启服务      try-start

    systemctl try-start named.service

      5. 优雅重启,重新载入配置文件而不中断服务   reload

    systemctl reload named.service

      6. 开机自启动                 enable

    systemctl enable named.service

      7. 禁止开机自启动               disable

    systemctl disable named.service

      8. 查看服务运行状态              status

    systemctl status named.service

      9. 查看服务是否开机自启动           is-enabled

    systemctl is-enabled named.service

      10. 查看服务开机自启动情况           list-unit-files --type=service

    systemctl list-unit-files --type=service

      11. 查看各服务在不同的运行级别下自启动情况

    ls /etc/systemd/system/*.wants/named.service

      12. 添加新的服务文件             daemon-reload

    systemctl daemon-reload

    电源管理

      1. 关闭系统                  poweroff

    systemctl poweroff

      2. 重启系统                  reboot

    systemctl reboot

      3. 待机模式                  suspend

    systectl suspend

      4. 休眠模式                  hibemate

    systemctl hibemate

      5. 混合休眠模式                hybrid-sleep

    systemctl hybrid-sleep
    

      

  • 相关阅读:
    2013 年最不可思议的 10 个硬件开源项目
    三款SDR平台对比:HackRF,bladeRF和USRP
    形同虚设:花费700美元便可突破门禁
    oracle timestamp和date区别
    linux服务器性能——CPU、内存、流量、磁盘使用率的监控
    通过安装memadmin对memcache进行可视化管理
    SNMP MIBs and IPv6
    使用 cacti 监控 windows 服务器硬盘的 I/O 状况
    snmp对超过16T的磁盘大小识别不对的解决办法
    源码编译安装net-snmp
  • 原文地址:https://www.cnblogs.com/2bjiujiu/p/9043858.html
Copyright © 2011-2022 走看看