日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql etc rc.local_CentOS 7 开机启动自定义配置文件:/etc/rc.local 不执行解决办法 | IT运维网...

發布時間:2025/3/20 数据库 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql etc rc.local_CentOS 7 开机启动自定义配置文件:/etc/rc.local 不执行解决办法 | IT运维网... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

最近在安裝程序時發現CentOS 7的開機自定義配置文件(/etc/rc.local)內配置了啟動腳本不會開機執行;于是查看了下配置文件內容發現了問題的原因

[root@localhost ~]# 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

上面的意思說這個文件是為了兼容性的問題而添加的,建議創建自己的systemd服務或udev規則來在開機時運行腳本而不是使用這個文件;與以前的版本引導時的并行執行相比較,這個腳本將不會在其他所有的服務后執行;必須執行“chmod +x /etc/rc.d/rc.local”來確保這個腳本在引導時執行。

于是查看權限時發現/etc/rc.d/rc.local文件并沒有執行權限

[root@localhost ~]# ll /etc/rc.local

lrwxrwxrwx. 1 root root 13 Feb 3 23:29 /etc/rc.local -> rc.d/rc.local

[root@localhost ~]# ll /etc/rc.d/rc.local

-rw-r--r--. 1 root root 473 Feb 1 04:53 /etc/rc.d/rc.local

因此按照提示配置執行權限并查驗

[root@localhost ~]# chmod +x /etc/rc.d/rc.local

[root@localhost ~]# ll /etc/rc.local

lrwxrwxrwx. 1 root root 13 Feb 3 23:29 /etc/rc.local -> rc.d/rc.local

[root@localhost ~]# ll /etc/rc.d/rc.local

-rwxr-xr-x. 1 root root 473 Feb 1 04:53 /etc/rc.d/rc.local

通過以上配置這個問題得以解決

與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

以上是生活随笔為你收集整理的mysql etc rc.local_CentOS 7 开机启动自定义配置文件:/etc/rc.local 不执行解决办法 | IT运维网...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。