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

  • 相关阅读:
    postgresql导入及导出
    高效构建Web应用 教你玩转Play框架 http://www.anool.net/?p=577
    强制远程桌面
    js对日期操作 获取两个日期的相差是否在几月之内
    ACM 擅长排列的小明
    路由vue-router
    小村系列之十五:倒了(修订版)
    小村系列之十三:次贷危机
    小村系列之十:民族主义的兴衰
    小村系列之八:村长开会
  • 原文地址:https://www.cnblogs.com/fqszywz/p/11312451.html
Copyright © 2011-2022 走看看