Centos 7 添加开机启动

摘要:
1、添加启动服务添加docker开机启动服务[root@localhost~]#systemctlenabledocker.serviceCreatedsymlinkfrom/etc/systemd/system/multi-user.target.wants/docker.serviceto/usr/lib/systemd/system/docker.service.2、添加启动脚本1、编写脚本
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

免责声明:文章转载自《Centos 7 添加开机启动》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇分享12个精妙有趣的HTML5应用SVN更新操作提示需要清理操作,清理操作提示乱码,更新SVN失败下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

解决centos7使用yum安装mysql 下载速度慢的问题

原文链接:https://blog.csdn.net/inslow/article/details/54177191 挺好用的,之前用腾讯云安装了半天,太慢了,改过之后速度快多了。 1、首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo 1 [root@localhost ~]# mv /etc/yum.r...

Ansible 系列之 Inventory 资源清单介绍

一、Inventory 库存清单文件 1.Inventory 作用 Ansible 可以在同一时间针对多个系统设施进行管理工作。它通过选择Ansible 资源清单文件中列出的系统,该清单文件默认是在/etc/ansible/hosts,也可以使用 -i <path> 进行路径的指定。文件内的格式INI 风格,中括号内为分组名。 除了这个文件之...

centos 删除指定文件之外的其他文件

linux下删除指定文件之外的其他文件   一、Linux下删除文件和文件夹常用命令如下: 删除文件: rm file  www.2cto.com   删除文件夹: rm -rf dir 需要注意的是, rmdir 只能够删除 空文件夹。   二、删除制定文件(夹)之外的所有文件呢?   1、方法1,比较麻烦的做法是: 复制需要保留的文件到其他文件夹,然后...

centos 7.5 编译并运行 opencv 4.5.1 c++

1.安装依赖项 1、yum install cmake -y 2、yum install gcc gcc-c++ kernel-devel -y 3、yum install gcc-gfortran -y 安装完后,可以用 gcc -v 、g++ -v 和 gfortran -v 查看版本。 4、yum install git -y 5、yum...

CentOS 5安装openssh

CentOS 5安装openssh - heipark's note - ITeye技术网站 CentOS 5安装openssh openssh 安装 卸载现有的openssh rpm -qa | grep openssh #列出要删除的rpm包 rpm -e x.rpm # 卸载 安装 官方网站:www.openssh.com wget ht...

Centos-挂载和卸载分区-mount

mount   挂载和卸载指定的分区 相关选项   -a      加载文件 /etc/fstab中指定的所有设备   -n      不降加载信息记录在 /etc/mtab文件中   -r      只读方式加载设备   -w       可读可写价值设备,属于mount默认设置   -f或-v     不加载设备,只查看mount挂载状态   -L  ...