[20201112]centos 7 rc.local shell script on systemd while booting Linux system.t
[20201112]centos 7 rc.local shell script on systemd while booting Linux system.txt
--//centos 7開始全面使用systemd管理啟動過程,說真的我自己非常不習慣,也許是老了,接受新生事物有點遲鈍。
--//而以前使用者要加入一些特殊命令一般都是選擇/etc/rc.d/rc.local.但是centos 7開始不會再呼叫執行。
# ls -l /etc/rc.local /etc/rc.d/rc.local
-rw-r--r--. 1 root root 485 2020-11-12 10:28:16 /etc/rc.d/rc.local
lrwxrwxrwx. 1 root root 13 2020-02-27 01:51:51 /etc/rc.local -> rc.d/rc.local
# systemctl status rc-local.service
* rc-local.service - /etc/rc.d/rc.local Compatibility
Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static; vendor preset: disabled)
Active: inactive (dead)
# systemctl enable rc-local.service
# systemctl start rc-local.service
# systemctl status rc-local.service
* rc-local.service - /etc/rc.d/rc.local Compatibility
Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static; vendor preset: disabled)
Active: inactive (dead)
Condition: start condition failed at Thu 2020-11-12 10:34:12 CST; 3s ago
ConditionFileIsExecutable=/etc/rc.d/rc.local was not met
--//不行。
# ls -l /etc/rc.d/rc.local
-rw-r--r--. 1 root root 485 2020-11-12 10:28:16 /etc/rc.d/rc.local
--//沒有執行許可權。
# chmod 744 /etc/rc.d/rc.local
# systemctl start rc-local.service
# systemctl status rc-local.service
* rc-local.service - /etc/rc.d/rc.local Compatibility
Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static; vendor preset: disabled)
Active: active (exited) since Thu 2020-11-12 10:36:05 CST; 1s ago
Process: 8078 ExecStart=/etc/rc.d/rc.local start (code=exited, status=0/SUCCESS)
Nov 12 10:36:05 localhost.localdomain systemd[1]: Starting /etc/rc.d/rc.local Compatibility...
Nov 12 10:36:05 localhost.localdomain rc.local[8078]: test
Nov 12 10:36:05 localhost.localdomain systemd[1]: Started /etc/rc.d/rc.local Compatibility.
--//ok現在已經執行成功了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2733684/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【Linux shell】while read lineLinuxWhile
- Shell Script
- shell script
- Linux(CentOS)啟動時自動執行指令碼(rc.local)LinuxCentOS指令碼
- Centos7 中 Systemd 的Unit檔案配置說明CentOS
- Linux Shell指令碼程式設計while語句案例Linux指令碼程式設計While
- systemd - yocto linux如何整合&配置systemdLinux
- shell script的簡單使用
- Linux CentOS 7 更新yum源LinuxCentOS
- Linux:使用systemd管理程式Linux
- linux啟動流程 (centos6,centos7)LinuxCentOS
- CentOS Linux7 安裝JDKCentOSLinuxJDK
- Linux CentOS 7 下 Redis 的配置LinuxCentOSRedis
- CentOS Linux release 7磁碟擴容CentOSLinux
- Linux守護程式及SystemdLinux
- linux(麒麟 centos7)安裝7zLinuxCentOS
- CentOS_linux7,固定靜態地址CentOSLinux
- Linux-Redis安裝(CentOS7)LinuxRedisCentOS
- CentOS8中systemd配置檔案說明CentOS
- 為什麼CentOS8開機不執行rc.localCentOS
- 【CentOS Linux 7】實驗4【Linux網路應用】CentOSLinux
- (Linux)CentOS7下安裝JDK 1.8LinuxCentOSJDK
- Linux(Centos7)Redis叢集的搭建LinuxCentOSRedis
- Linux Centos7傳送QQ郵件LinuxCentOS
- 阿里雲centos7[linux]安裝nginx阿里CentOSLinuxNginx
- Linux Centos7 nodeJS專案上線LinuxCentOSNodeJS
- Linux – CentOS 7 yum方式快速安裝MongoDBLinuxCentOSMongoDB
- Shell指令碼應用 – for、while迴圈語句指令碼While
- shell script程式設計小結——附帶例項程式設計
- Linux服務管理神器:SYSTEMD介紹Linux
- linux 常用命令(五)——(centos7-centos6.8)JDK安裝LinuxCentOSJDK
- Linux ShellLinux
- Linux(Centos7)安裝Docker 社群(ce)版LinuxCentOSDocker
- Linux(CentOS7)安裝最新版PythonLinuxCentOSPython
- linux centos7部署anaconda3LinuxCentOS
- Linux Centos 7安裝MongoDB(簡單!詳細!)LinuxCentOSMongoDB
- Linux-CentOS7環境MySQL安裝配置LinuxCentOSMySql
- Linux(CentOS7)使用vim編輯檔案LinuxCentOS