Last active
August 27, 2020 09:02
-
-
Save cn27529/58e6d84550819740eac1dfe568ef9c09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1.sudo su 切換到root權限 | |
# 2.以root身分, 進入lib/systemd/system/ 查看是否有rc.local.service檔案, 一般都會有啦XD | |
若沒有就走2-1 | |
## 2-1.nano lib/systemd/system/rc.local.service | |
在文件中最後加上 | |
[Install] | |
WantedBy=multi-user.target | |
Alias=rc.local.service | |
將rc.local.service存檔離開 | |
# 3.去etc/下建立 rc.local 檔 | |
cd /etc | |
sudo touch rc.local | |
nano rc.local | |
填入內容如下 | |
#!/bin/sh -e | |
# | |
# rc.local | |
# | |
# This script is executed at the end of each multiuser runlevel. | |
# Make sure that the script will “exit 0” on success or any other | |
# value on error. | |
# | |
# In order to enable or disable this script just change the execution | |
# bits. | |
# | |
# By default this script does nothing. | |
#每次啟動自動執行Glances 命令列系統監控工具 | |
glances -w | |
exit 0 | |
4.rc.local 變更執行權限 | |
sudo chmod +R 777 /etc/rc.local | |
5.啟用服務 | |
sudo systemctl enable rc.local.service | |
6.重開機如果有自動glances -w就是成功囉! | |
參考 | |
https://www.webteach.tw/?p=2621 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment