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

  • 相关阅读:
    mysql -- 字符串子串
    eclipse 快捷键
    eclipse git --- add to index
    eclipse -- git 同步
    jquery
    烂泥:KVM、kickstart与NFS集成
    烂泥:KVM与kickstart集成
    烂泥:kickstart无人值守安装CentOS6.5
    烂泥:【解决】Ubuntu下使用SSH连接centos系统很慢
    烂泥:CentOS安装及配置TFTP服务器
  • 原文地址:https://www.cnblogs.com/fqszywz/p/11312451.html
Copyright © 2011-2022 走看看