centos如何將服務設置爲開機自啓動

  1. 查看開機啓動項

systemctl list-unit-files        #查看所有開機啓動項的狀態

systemctl list-unit-files|grep ‘服務名成’    #查看指定服務是否已設置開機啓動

systemctl list-unit-files|grep enable     #查看所有已設置開機啓動的服務

 

  1. 設置開機自啓動

systemctl enable ‘服務名稱’      #將制定服務設置爲開機啓動

例如:

systemctl enable nginx        #nginx設置爲開啓自啓動

systemctl enable supervisord        #supervisor設置爲開啓自啓動

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章