systemctl管理服務的啟動,重啟,停止,重載,查看狀態的命令
Systcinit命令(紅帽RHEL6系統) | Systemctl命令(紅帽RHEL7系統) | 作用 |
service foo start | systemctl start foo.service | 啟動服務 |
service foo restart | systemctl restart foo.service | 重啟服務 |
service foo stop | systemctl stop foo.service | 停止服務 |
service foo reload | systemctl reload foo.service | 重新加載配置文件(不終止服務) |
service foo status | systemctl status foo.service | 查看服務狀態 |
systemctl設置服務的開機啟動,不啟動,查看各級別下服務啟動狀態的命令
Sysvinit命令(紅帽RHEL6系統) | Systemctl命令(紅帽RHEL7系統) | 作用 |
chkconfig foo on | systemctk enable foo.service | 開機自動啟動 |
chkconfig foo off | systemctl disable foo.service | 開機不自動啟動 |
chkconfig foo | systemctl is-enabled foo.service | 查看特定服務是否為開機自啟動 |
chkconfig --list | systemctl list-unit-files --type=service | 查看各個級別下服務的啟動與禁用情況 |