zoukankan      html  css  js  c++  java
  • RHEL7运行级别和服务

    一 RHEL7运行级别

    systemd使用“target”而不是运行级。默认情况下,有两个主要

    target:multi-user.target:类似于运行级别3

    graphical.target:类似于运行级5

    1)查看当前默认目标,运行:

    systemctl get-default

    2)设置一个默认目标,运行:

    systemctl set-default TARGET.target

    3)查看默认运行级别

    [root@RHEL7 ~]# systemctl get-default

    multi-user.target

    4)设置默认的运行级别

    [root@RHEL7 ~]# systemctl set-default multi-user.target

    rm '/etc/systemd/system/default.target'

    ln -s '/usr/lib/systemd/system/multi-user.target' '/etc/systemd/system/default.target'

    5)切换运行级别

    [root@RHEL7 ~]# systemctl isolate multi-user.target

    二 RHEL7服务

    systemd 的主要的命令行工具是systemctl

    注意:servic和 chkconfig 在引进systemd 照常可以使用

    systemctl 的语法格式

    systemctl start [服务名称]  启动 

    systemctl restart [服务名称]   重新启动

    systemctl stop [服务名称]   停止

    systemctl status [服务名称]   状态查询

    systemctl enable  [服务名称]  开机自启

    systemctl disable  [服务名称]   服务开机不启动

    sudo systemctl kill httpd.service有时候,该命令可能没有响应,服务停不下来。这时候就不得不"杀进程"了,向正在运行的进程发出kill信号。

    查看所有服务的状态:systemctl list-unit-files

    锁定服务:systemctl mask sshd   #此时这个服务不可以进行操作

    解除服务的锁定:systemctl unmask sshd

    列出服务间的依赖关系:systemctl list-dependencies

  • 相关阅读:
    LRU算法简介
    linux下安装nginx+php+mysql环境 详细教程
    CentOS 6.6编译安装Nginx1.6.2+MySQL5.6.21+PHP5.6.3
    unicode 格式 转汉字
    js 操作cookie
    哈希函数
    php商城秒杀活动
    php 栈、 出栈、入栈
    php单例模式
    封装PHP增删改查方法
  • 原文地址:https://www.cnblogs.com/dotagg/p/6478208.html
Copyright © 2011-2022 走看看