1. 列举程序
chkconfig:
chkconfig --list
systemd:
systemctl list-units
2. 启用服务
chkconfig:
chkconfig <service-name> on
systemd:
systemctl enable <service-name>.service
3.禁用服务
chkconfig:
chkconfig <service-name> off
systemd:
systemctl disable <service-name>.service
4. 启动服务
chkconfig:
service <service-name> start
systemd:
systemctl start <service-name>.service
5. 停止服务
chkconfig:
service <service-name> stop
systemd:
systemctl stop <service-name>.service
6. 检查服务状态
chkconfig:
service <service-name> status
systemd:
systemctl status <service-name>.service
参考:
https://bencane.com/2012/01/19/cheat-sheet-systemctl-vs-chkconfig/