zoukankan      html  css  js  c++  java
  • Linux中使用systemctl操作服务、新建自定义服务

    Linux有12种Unit,对于个人来讲,用的最多的是Service Unit,下面的Unit均指Service Unit(服务单元)

    # 启动Unit

    systemctl start appname.service

    # 停止Unit

    systemctl stop appname.service

    # 重启Unit

    systemctl restart appname.service

    # 重新加载Unit的配置文件

    systemctl reload appname.service

    # 重新加载所有Unit的配置文件

    systemctl daemon-reload

    tip:重新加载需要重新启动Unit才生效

    # 开机启动Unit

    systemctl enable appname.service

    # 禁止开机启动Unit

    systemctl disable appname.service

    # 查看Unit状态

    systemctl status appname.service

    # 查看Unit是否运行

    systemctl is-active appname.service

    # 查看Unit是否启动失败

    systemctl is-failed appname.service

    # 显示Unit是否建立了启动链接

    systemctl is-enabled appname.service

    当然也可以使用 service命令对服务进行操作,具体可看这里

    对于更完全的对 systemd,systemctl,Unit的解读,可看这里

  • 相关阅读:
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    codevs 1501 二叉树最大宽度和高度x
  • 原文地址:https://www.cnblogs.com/convict/p/13930592.html
Copyright © 2011-2022 走看看