Systemd已经基本取代了SysV的Init,这篇文章从几个方面整理一下Systemd与Init的使用上的区别。
命令比较: SysVinit vs Systemd
命令用途 | SysVInit命令 | Systemd命令 |
---|---|---|
服务启动 | service 服务名 start | systemd start 服务名.service (.service可省略,后同) |
服务停止 | service 服务名 stop | systemctl stop 服务名 |
服务重启 | service 服务名 restart | systemctl restart 服务名 |
服务重新加载 | service 服务名 reload | systemctl reload 服务名 |
服务状态确认 | service 服务名 status | systemctl status 服务名 |
服务开机启动设定 | chkconfig 服务名 on | systemctl enable 服务名 |
取消服务开机启动设定 | chkconfig service off | systemctl disable 服务名 |
确认服务开机启动设定状态 | chkconfig 服务名 | systemctl is-enabled 服务名 |
加载服务配置文件 | chkconfig 服务名 -add | systemctl deamon-reload |
关机 | halt | systemctl halt |
关机(电源) | poweroff | systemctl poweroff |
重启 | reboot | systemctl reboot |
休眠 | pm-hibernate | systemctl hibernate |
挂起 | pm-suspend | systemctl suspend |