[root@yistack-cloud-aio ~]# ls -lrt /etc/rc.d/rc.local
-rw-r--r-- 1 root root 473 4月 1 00:45 /etc/rc.d/rc.local
[root@yistack-cloud-aio ~]# ls -lrt /etc/rc.local
lrwxrwxrwx 1 root root 13 4月 18 15:15 /etc/rc.local -> rc.d/rc.local
哈哈哈哈,是因为/etc/rc.local 是/etc/rc.d/rc.local 的软连接文件,此文件没X执行权限,因此 开机不执行!!!!!!!
#!/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 constrast 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. |
#这个文件是为了兼容性的问题而添加的。 # #强烈建议创建自己的systemd服务或udev规则来在开机时运行脚本而不是使用这个文件。 # #与以前的版本引导时的并行执行相比较,这个脚本将不会在其他所有的服务后执行。 # #请记住,你必须执行“chmod +x /etc/rc.d/rc.local”来确保确保这个脚本在引导时执行。 |
[root@localhost ~] # ll /etc/rc.local lrwxrwxrwx. 1 root root 13 8月 12 06:09 /etc/rc . local -> rc.d /rc . local [root@localhost ~] # ll /etc/rc.d/rc.local -rw-r--r--. 1 root root 477 6月 10 13:35 /etc/rc .d /rc . local |
chmod +x /etc/rc .d /rc . local |
看样子是版本的变迁,/etc/rc.local /etc/rc.d/rc.local正在弃用的路上。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
2015-04-20 tomcat root dir log 配置
2015-04-20 Oracle password expire notices
2015-04-20 CentOS bridge br0 kvm libvirt-xml
2015-04-20 国内常用ntp服务器ip地址
2014-04-20 OpenSUSE SuSEfirewall2