一、centos7、red hat7 取消了運(yùn)行級(jí)別的概念,用systemd代替了init中的運(yùn)行級(jí)別概念。
二、用“l(fā)n”命令把“多用戶,無(wú)圖形”目標(biāo)文件鏈接到/etc/systemd/system/目錄中:
# ln -sf /lib/systemd/system/multi-user.target
/etc/systemd/system/default.target 注:實(shí)現(xiàn)開(kāi)機(jī)進(jìn)入命令行界面。
三、使用“systemctl”命令管理服務(wù)
systemctl star 服務(wù)名.service 啟動(dòng)服務(wù)
systemctl restart 服務(wù)名.service 重啟服務(wù)
systemctl stop 服務(wù)名.service 停止服務(wù)
systemctl reload 服務(wù)名.service 重新加載配置文件(不終止服務(wù))
systemctl status 服務(wù)名.service 查看服務(wù)狀態(tài)
四、使用“systemctl”設(shè)置開(kāi)機(jī)啟動(dòng)、不啟動(dòng)、查看各級(jí)別下服務(wù)啟動(dòng)狀態(tài)
systemctl enable 服務(wù)名.service 開(kāi)機(jī)自啟服務(wù)
systemctl disable 服務(wù)名.service 開(kāi)啟不自啟服務(wù)
systemctl is-enabled 服務(wù)名.service 查看特定服務(wù)是否開(kāi)機(jī)自啟
systemctl list-unit-files --type=service 查看各級(jí)別下服務(wù)啟動(dòng)與禁用情況
熱門(mén)工具 換一換
