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

  • 相关阅读:
    【转】织梦为栏目添加图片的方法
    写在php设计模式前
    memcache 开机启动
    php 列出当前目录
    print echo 的区别
    php 报错等级
    nginx 启动脚本
    centos 编译 安装php
    修改linux iptable规则
    linux yum 安装软件
  • 原文地址:https://www.cnblogs.com/aaroncnblogs/p/9078764.html
Copyright © 2011-2022 走看看