1.查看開機自啟項
centos7自啟項已不用chkconfig改為:
systemctl list-unit-files
左邊是服務名稱,右邊是狀態,enabled是開機啟動,disabled是開機不啟動。
當然還可以過濾一下 比如:查看啟動項
systemctl list-unit-files | grep enable
2.設置開機自啟項
systemctl enable redis
systemctl enable nginx.service
啟動nginx
systemctl start nginx.service
結束nginx
systemctl stop nginx.service
重啟nginx
systemctl restart nginx.service