在centos6中有一个/etc/rc.local的启动文件,只要把需要经常启动的程序添加到此文件下并执行source /etc/rc.local就可以实现开机启动了。

在centos7中不知道也是如此操作吗?

    [root@centos ~]# cat /etc/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
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure ,看到这句话,就会发现需要给文件/etc/rc.local添加执行权限就可以实现程序自启动。

centos7下的/etc/rc.local自启动程序的更多相关文章

  1. rc.local自启动学习(转)

    linux有自己一套完整的启动体系,抓住了linux启动的脉络,linux的启动过程将不再神秘. 本文中假设inittab中设置的init tree为: /etc/rc.d/rc0.d/etc/rc. ...

  2. rc.local自启动学习

    在CentOS系统下,主要有三种方法设置自己安装的程序开机启动.1.把启动程序的命令添加到/etc/rc.d/rc.local文件中,比如下面的是设置开机启动httpd. #!/bin/sh # # ...

  3. Centos7下shell脚本添加开机自启动

    添加开机自启脚本,注意都需要用绝对路径 psubscribe.sh脚本中的内容: nohup /usr/bin/php -f /data/aliyun51015cn/redisChannel/psub ...

  4. centos7下/etc/rc.local文件里配置的开机启动项不执行的解决办法

    习惯于在/etc/rc.local文件里配置我们需要开机启动的服务,这个在centos6系统下是正常生效的.但是到了centos7系统下,发现/etc/rc.local文件里的开机启动项不执行了!仔细 ...

  5. Centos7中rc.local设置springboot项目开机自启动

    在Centos7下,rc.local文件,开机默认是不执行的 1.进入rc.local中 路径如下图

  6. Centos7下rc.local文件开机不执行…

    在Centos7下,rc.local文件,开机默认是不执行的 /etc/rc.local链接的是  /etc/rc.d/rc.local文件,该文件默认不开机启动,官方建议添加一个service来实现 ...

  7. 曹工改bug:centos下,mongodb开机不能自启动,systemctl、rc.local都试了,还是不行,要不要放弃?

    问题背景 最近装个centos 7.6的环境,其中,基础环境包括,redis.nginx.mongodb.fastdfs.mysql等,其中,自启动使用的是systemctl,其他几个组件,都没啥问题 ...

  8. Linux开机启动程序rc.local

    目录 1./etc/rc.local是/etc/rc.d/rc.local的软链接 2.rc.local文件的原始内容 3.rc.local文件的配置 4.应用经验 5.版权声明 在CentOS7中, ...

  9. CentOS7 rc.local开机开法启动

    CentOS 7添加开机启动服务/脚本 一.添加开机自启服务 在CentOS 7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例):systemctl enable jenkins.s ...

随机推荐

  1. c# 子窗体居中父窗体

    1.设置CenterParent不管用.只好用代码控制. frmRunning_ = new FrmRunning(); frmRunning_.StartPosition = FormStartPo ...

  2. QFramework 使用指南 2020 (一): 概述

    大家好,我是 QFramework 的作者 凉鞋,QFramework 从第一次代码提交到现在快 5 年了,期间陆陆续续增加了很多功能,在使用体验上做了大量的改进. 而市面上关于 QFramework ...

  3. Spring 视图层如何显示验证消息提示

    1.示例 <p th:if="${#fields.hasErrors('name')}" th:errors="*{name}" ></p&g ...

  4. Vue父子组件传值$parent , ref,$refs,props大总结

    子组件: <template> <div class="child"> <slot name='meiyong'></slot> & ...

  5. springBoot--组合注解RestController,GetMapping,PostMapping

    一.RestController @RestController 是@Controller和@ResponseBody的缩写 二.@getMapping和PostMapping @GetMapping ...

  6. tcp与串口透传(select)

    介绍 tcp作为服务端,监听端口8888,实现串口透传,这里是使用select监听tcp的receive和串口的read,单工通信 -p 指定tcp端口 -s 指定串口 -b 指定波特率 支持4800 ...

  7. grafana的metric的计算语句

    1.磁盘使用率 .other:((node_filesystem_size_bytes{fstype=~ .my: ((node_filesystem_size_bytes{fstype=~ 2.se ...

  8. redis的发布和订阅操作

  9. 菜鸟系列Fabric源码学习—创建通道

    通道创建源码解析 1. 与通道创建相关配置及操作命令 主要是configtx.yaml.通过应用通道的profile生成创建通道的配置文件. TwoOrgsChannel: Consortium: S ...

  10. [转帖]phoronix-test-suite 简介

    <工作杂记>之phoronix-test-suite 2017年10月30日 14:32:52 打雷下雨 阅读数 2078更多 分类专栏: # linux   版权声明:本文为博主原创文章 ...