首页 > 其他 > 详细

Centos 7 添加开机启动

时间:2019-10-29 14:55:20      阅读:81      评论:0      收藏:0      [点我收藏+]

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 添加开机启动

原文:https://www.cnblogs.com/hzw97/p/11758199.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!