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

  • 相关阅读:
    致21岁的自己
    nginx 入门实战
    软件测试的分类
    Springboot 使用 Jedis
    NodeJS模块、包、NPM
    NodeJS介绍
    毫秒必争,前端网页性能最佳实践--转载
    IT主要在线学习网站
    电商峰值系统架构设计--转载
    查看w3wp进程占用的内存及.NET内存泄露,死锁分析--转载
  • 原文地址:https://www.cnblogs.com/dotagg/p/6478208.html
Copyright © 2011-2022 走看看