[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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Shell Script
- shell script
- 【Linux shell】while read lineLinuxWhile
- Centos7 中 Systemd 的Unit檔案配置說明CentOS
- Shell Script(轉)
- Shell Script to Calculate Values Recommended Linux HugePagesLinux
- shell script to rename directory
- Linux(CentOS)啟動時自動執行指令碼(rc.local)LinuxCentOS指令碼
- Linux程式設計-11.Shell Script(bash)--(3)用於自動備份的Shell Script(轉)Linux程式設計
- Shell Script(bash)--用於自動備份的Shell Script(轉)
- Linux Shell指令碼程式設計while語句案例Linux指令碼程式設計While
- shell script的簡單使用
- execute shell script from stored procedure
- Bourne shell script中的quoting
- Shell Script(bash)--教學例(轉)
- Linux程式設計-11.Shell Script(bash)--(1)簡介(轉)Linux程式設計
- Linux:使用systemd管理程式Linux
- Linux CentOS 7 更新yum源LinuxCentOS
- linux shell 學習摘記(7)Linux
- Linux Shell Awk 流程控制語句(if,for,while,do)詳細介紹LinuxWhile
- CentOS8中systemd配置檔案說明CentOS
- [Shell] 指令碼案例(1)--while,for,RANDOM,case指令碼Whilerandom
- [shell基礎]——if/for/while/until/case 語句While
- linux啟動流程 (centos6,centos7)LinuxCentOS
- Linux程式設計-11.Shell Script(bash)--(2)教學例(轉)Linux程式設計
- 20天學會bash shell script (二)
- 20天會學bash shell script(一)
- 20 天學會bash shell script (三)
- 為什麼CentOS8開機不執行rc.localCentOS
- Linux守護程式及SystemdLinux
- CentOS Linux release 7磁碟擴容CentOSLinux
- Linux CentOS 7 下 Redis 的配置LinuxCentOSRedis
- CentOS Linux7 安裝JDKCentOSLinuxJDK
- 小的shell script進不同系統的
- PHP也可以當成Shell Script使用(轉)PHP
- Notes for Linux Administration Handbook (1) : Booting and Shutting DownLinuxboot
- Centos系統中 Systemd 的Unit檔案配置說明CentOS
- Linux-Redis安裝(CentOS7)LinuxRedisCentOS