
Ubuntu和CentOS管理服務相關指令
Linux 常用指令設定開機啟動或停用開機啟動等不同狀況,整理相關指令有需要時可以快速調整服務狀態。
systemctl is-enabled servicename.service
#查詢服務是否開機時啟動
systemctl enable servicename.service
#開機時啟動服務
systemctl disable servicename.service
#禁止開機時啟動服務
systemctl start servicename.service
#啟動服務
systemctl stop servicename.service
#停止服務
systemctl restart servicename.service
#重啟服務
systemctl reload servicename.service
#重新讀取服務配置檔
systemctl status servicename.service
#查詢服務狀態
參考來源:
收錄於「#CentOS」系列手札

獨立技術專刊推播
訂閱技術電子報
有新文章發布時寄送到您的信箱,不發送垃圾信。