zoukankan      html  css  js  c++  java
  • 开机自启动

    查看Systemd版本:systemctl --version

    子命令:

    systemctl reboot  //重启

    systemd-analyze  //查看启动耗时

    hostnamectl  //查看系统信息

    localectl  //查看本地化设置

    timedatectl  //查看时区设置

    loginctl  //查看当前登录的用户

    Unit

    systemctl list-units  //查看当前系统所有Unit

    systemctl status keepalived.service  //查看某个Unit状态

    systemctl start/stop keepalived.service  //启动/停止服务

    默认配置文件路径:/etc/systemd/system/ -> /usr/lib/systemd/system

    systemctl enable xxx.service  //建立符号链接(如果配置文件设置了开机启动,激活开机启动)

    配置文件后缀名是Unit的种类:service系统服务、target多个Unit组

    systemctl list-unit-files  //列出配置文件的状态,enabled已建立启动链接,disabled未建立启动链接,static配置文件无Install部分,无法执行,只能作为其他配置文件的依赖,masked禁止建立启动链接

    systemctl cat xxx.service  //查看配置文件

    [Unit]
    Description=XXX

    [Service]
    Type=idle
    ExecStart=/opt/elb_boot.sh

    [Install]
    WantedBy=multi-user.target  //被包含在/etc/systemd/system/xxx.target.wants

    参考:

    http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-commands.html

    http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-part-two.html

  • 相关阅读:
    prometheus监控zookeeper
    prometheus监控mongo
    python游戏练手--乒乓球
    python游戏练手--贪吃蛇
    python爬虫练手--糗事百科图片获取
    Prometheus监控安装及使用(一)
    善用k8s explain
    k8s deployment
    k8s pod
    k8s deployment 金丝雀发布 更新的 暂停 恢复 回滚
  • 原文地址:https://www.cnblogs.com/aaroncnblogs/p/9078764.html
Copyright © 2011-2022 走看看