zoukankan      html  css  js  c++  java
  • Centos 7 添加开机启动

    1、添加启动服务

    添加docker开机启动服务

    [root@localhost ~]# systemctl enable docker.service
    Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.

    2、添加启动脚本

    1、编写脚本

    [root@localhost ~]# vi ping_route_donot_del.sh
    ping 10.47.85.129 &
    [root@localhost ~]# chomd +x ping_route_donot_del.sh

    2、添加开机启动

    [root@localhost ~]# vi /etc/rc.d/rc.local
    #!/bin/bash
    # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
    #
    # It is highly advisable to create own systemd services or udev rules
    # to run scripts during boot instead of using this file.
    #
    # In contrast to previous versions due to parallel execution during boot
    # this script will NOT be run after all other services.
    #
    # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
    # that this script will be executed during boot.

    touch /var/lock/subsys/local
    /root/ping_route_donot_del.sh

    3、赋予开机启动权限

    [root@localhost ~]#chmod +x /etc/rc.d/rc.local

  • 相关阅读:
    新人讲解
    为人处世
    项目管理
    读书
    游戏
    总结反思
    地图相关
    产品经理
    摄影
    Java 邮件发送
  • 原文地址:https://www.cnblogs.com/hzw97/p/11758199.html
Copyright © 2011-2022 走看看