zoukankan      html  css  js  c++  java
  • systemctl

    systemctl

    启动:service NAME start ==> systemctl start NAME.service/NAME
    停止:service NAME stop ==> systemctl stop NAME.service/NAME
    重启:service NAME restart ==> systemctl restart NAME.service/NAME
    状态:service NAME status ==> systemctl status NAME.service/NAME
    条件式重启:service NAME condrestart ==> systemctl try-restart NAME.service/NAME
    重载或重启服务:systemctl reload-or-restart NAME.service
    重载或条件式重启服务:systemctl reload-or-try-restart NAME.service

    查看某服务当前激活与否的状态:systemctl is-active NAME.service
    查看所有已激活的服务:systemctl list-units --type service
    查看所有服务(已激活及未激活):chkconfig --isit ==>systemctl list-units -t service -all

    设置服务开机自启:chkconfig NAME on ==> systemctl enable NAME.service
    禁止服务开机自启:chkconfig NAME off ==> systemctl disable NAME.service
    查看某服务是否能开机自启:chkconfig --list NAME ==> systemctl is-enabled NAME.service

    禁止某服务设定为开机自启:systemctl mask NAME.service
    取消此禁止:systemctl unmask NAME.service

    查看某服务的依赖关系 list-dependencies NAME.service (CentOS7 支持此命令)


    管理target units:
    运行级别:
    0 ==> runlevel0.target,poweroff.target
    1 ==> runlevel1.target,rescue.target (救援模式)
    2 ==> runlevel2.target,multi-user.target
    3 ==> runlevel3.target,multi-user.target
    4 ==> runlevel3.target,multi-user.target
    5 ==> runlevel5.target,graphlcal.target
    6 ==> runlevel6.target,reboot.target

    级别切换:init N ==> systemctl isolate NAME.target

    查看级别:runlevel ==> systemctl list-units --type target
    查看所有级别:systemctl list-units -t target -a

    获取默认运行级别:systemctl get0default
    修改默认运行级别:systemctl set-default NAME.target

    切换至紧急救援模式:systemctl rescue
    切换至emergency模式:systemctl emergency

    其他常用命令:
    关机:systemctl halt,systemctl poweroff
    重启:systemctl reboot
    挂起:systemctl suspend
    快照:systemctl hibernate
    快照并挂起:systemctl hybrid-sleep

  • 相关阅读:
    随笔
    第一次随笔
    团队战day02-接口
    团队战day01-初步搭建UI
    团队战start-确定项目以及介绍
    团队—易软
    找回感觉的练习
    第五次作业-团队作业-团队组建
    第四次博客作业-结对项目
    java第九次作业
  • 原文地址:https://www.cnblogs.com/fqszywz/p/11312451.html
Copyright © 2011-2022 走看看