CentOS中在/etc/rc.local添加开机自启动项启动失败
2017-07-16 15:57
543 查看
应项目要求需要在开机的时候启动自己的Agent程序,想当然的直接就往
其实
/etc/rc.local当中添加启动命令,结果重启之后发现什么都没有发生....一开始还以为是Python路径的问题,结果改成绝对路径之后还是一样,一番搜索之后发现原来是权限问题,执行
chmod a+x /etc/rc.d/rc.local解决问题。
其实
/etc/rc.local的说明当中已经说的很清楚了,
/etc/rc.local只是为了兼容而设置的,若要执行需要为
/etc/rc.d/rc.local添加执行权限,看来还是不能慌呀,项目再忙也不能乱了手脚,本来这种稍微看下文档说明就解决了的问题,结果还是瞎折腾了一下,磨刀不误砍柴工,古人诚不欺我。
/etc/rc.local实为
/etc/rc.d/rc.local的软连接
[root@10-10-50-109 ~]# ls -l /etc/rc.local lrwxrwxrwx 1 root root 13 May 26 09:38 /etc/rc.local -> rc.d/rc.local
/etc/rc.d/rc.local默认权限为不可执行
[root@10-10-50-109 ~]# ls -l /etc/rc.d/rc.local -rw-r--r-- 1 root root 473 Apr 13 03:57 /etc/rc.d/rc.local [root@10-10-50-109 ~]#
/etc/rc.local当中的说明
[root@10-10-50-109 ~]# 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 [root@10-10-50-109 ~]#
相关文章推荐
- CentOS开机启动 /etc/rc.d/rc.local
- Linux开机启动/etc/rc.d/rc.local 中部分命令执行失败
- centos 7 添加 nfs 开机启动失败解决方法
- CentOS 7 —— /etc/rc.local 开机不执行 - 解决方法
- centos7 开机自启动 /etc/rc.local 不执行的问题
- centos7 的/etc/rc.local不会开机执行
- centos7 开机/etc/rc.local 不执行的问题
- centos 7.1开机/etc/rc.local脚本不执行的问题
- centos 7 /etc/rc.local 开机不执行的问题
- centos 7 /etc/rc.local 开机不执行的问题
- centos 7 /etc/rc.local 开机不执行的问题
- CentOS7 的/etc/rc.local不会开机执行解决方案
- centos开机自动启动SVN服务的方法1、编辑rc.local文件
- 开机启动/etc/rc.local失效无效怎么办?解决方法
- CentOS7 rc.local开机开法启动
- centos7 开机/etc/rc.local 不执行的问题及部分命令执行不成功
- CentOS7 rc.local开机开法启动
- Centos 7关于rc.local脚本命令开机不执行及指定用户启动的解决方法
- chkconfig 添加灵活被系统控制服务, /etc/rc.local中添加开机自启动程序, /etc/profile中添加二进制命令
- 普通用户开机启动服务/etc/rc.local