最近在设置CentOS开机自动启动程序时遇到一个问题,脚本本身测试没有问题,但实际程序开机自启失败,查看/var/log/boot.log
日志,提示File size limit exceeded错误,大致意思就是提示您超出文件大小限制。
CentOS开机自启设置可以将脚本写入到/etc/rc.local
配置文件中,但是似乎启动失败了,查看启动日志提示File size limit exceeded,原因是这个配置文件中限制了执行脚本大小导致ulimit -SH 65535
#!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local #ulimit -SH 65535 cd /home/bitsync;./btsync --config btsync.conf
将ulimit -SH 65535
这一行注释或者删除,然后reboot
重启系统,最后开机自动执行脚本成功。
Copyright © 2013-2021 8a.hk All Rights Reserved. 八艾云 版权所有 中山市八艾云计算有限公司 粤ICP备14095776号