CentOS7設定開機自啟動命令大全

2021-09-08 19:03:02 字數 1158 閱讀 2090

任務

舊指令新指令

使某服務自動啟動

使某服務不自動啟動

檢查服務狀態

systemctl status httpd.service (服務詳細資訊) 

systemctl is-active httpd.service (僅顯示是否 active)

顯示所有已啟動的服務

chkconfig --list

systemctl list-units --type=service

啟動某服務

停止某服務

重啟某服務

啟動nginx服務

systemctl start nginx.service
設定開機自啟動

systemctl enable nginx.service
停止開機自啟動

systemctl disable nginx.service
檢視服務當前狀態

systemctl status nginx.service
重新啟動服務

systemctl restart nginx.service
檢視所有已啟動的服務

systemctl list-units --type=service

Centos7下Redis設定開機自啟動服務

有個同事說重啟了伺服器沒有自啟動redis,我看了一下,是以前手動編譯安裝的模式,沒有配置開機啟動的服務 這邊做個筆記記錄一下redis如何設定編譯安裝模式的開機自啟動。配置檔案路徑 etc redis.conf daemonize是守護程序的意思 把daemonize no改成daemonize ...

centos7 掛載磁碟設定開機自啟動

1.首先檢視系統磁碟情況 2.格式化自己想要掛載的磁碟型別 ext3 ext4現在主要使用的是這些 3.檢視自己格式化磁碟的uuid 使用uuid掛載是唯一標識安全 4.複製uuid號 別複製雙引號 新建自己要掛載的目錄,新增uuid到 etc fstab最後一行進行掛載 notice 如上圖進行新...

CentOS7的網絡卡開機自啟動

本來以為centos7的網絡卡開機啟動應該是 systemctl enable network 但是設定了始終還是沒有開機啟動網路服務,最好只好去改配置檔案 vi etc sysconfig network scrips ifcfg ens33 type ethernet bootproto non...