rc.local 不执行解决方法 开机启动
2017-09-28 14:31
447 查看
1,脚本环境变量的问题
2,rc.local没有可执行权限
2,rc.local没有可执行权限
[root@localhost ~]# cat /etc/init.d/start_svn.sh #!/bin/bash SvnRepoPath='/home/svnrepos/' while [ 1 ] do ps -ef > /tmp/tmp_svnserve cat /tmp/tmp_svnserve | grep 'svnserve -d -r' if [ $? -eq 0 ] then echo "`date '+%F_%H:%M:%S'` svnsrever start OK!" > /tmp/tmp_svnserve exit else /usr/bin/svnserve -d -r $SvnRepoPath echo "`date '+%F_%H:%M:%S'` svnsrever starting" > /tmp/tmp_svnserve fi sleep 1 done [root@localhost ~]#
[root@localhost ~]# cat /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 /bin/bash /etc/rc.d/init.d/start_svn.sh echo "`date '+%F_%H:%M:%S'` rc.local work done" >> /tmp/tmp_rc.local_log [root@localhost ~]#
[root@localhost ~]# ll /etc/rc.d/rc.local -rw-r--r--. 1 root root 587 9月 28 14:11 /etc/rc.d/rc.local [root@localhost ~]# chmod +x /etc/rc.d/rc.local [root@localhost ~]# ll /etc/rc.d/rc.local -rwxr-xr-x. 1 root root 587 9月 28 14:11 /etc/rc.d/rc.local [root@localhost ~]#
相关文章推荐
- Centos 7关于rc.local脚本命令开机不执行及指定用户启动的解决方法
- 解决Linux开机启动文件rc.local不能自动执行
- Arch下systemd无法开机执行rc.local之解决方法
- 开机启动/etc/rc.local失效无效怎么办?解决方法
- CentOS 7 —— /etc/rc.local 开机不执行 - 解决方法
- Linux开机启动文件rc.local无法执行,开机后手动可以启动文件
- Mac OS X 使用 rc.local 开机执行命令设置方法
- Mac下用Launchd实现使用rc.local执行开机启动命令
- Linux开机启动rc.local不执行分析
- 解决centos7 开机/etc/rc.local 不执行的问题
- 解决centos7 开机/etc/rc.local 不执行的问题
- Ubuntu 16.04设置rc.local开机启动命令/脚本的方法
- Debian 9.x “stretch” 解决 /etc/rc.local 开机启动问题
- Ubuntu 16.04设置rc.local开机启动命令/脚本的方法(通过update-rc.d管理Ubuntu开机启动程序/服务)
- CentOS 6下rc.local中的命令在启动后不能自动执行问题的排查方法
- 解决centos7 开机/etc/rc.local 不执行的问题
- centos开机自动启动SVN服务的方法1、编辑rc.local文件
- 解决centos7 开机/etc/rc.local 不执行的问题
- Linux开机启动/etc/rc.d/rc.local 中部分命令执行失败
- Ubuntu 创建开机启动脚本的一种方法(rc.local)