查看开机启动项
# CentOS6
chkconfig --list
chkconfig sshd --list
# CentOS7
systemctl list-unit-files
systemctl list-unit-files|grep sshd.service
开启关闭服务
# CentOS6
# 启动/关闭/重启/显示一个服务
service telnet start/stop/restart/status
# CentOS7
# 启动/关闭/重启/显示一个服务
systemctl start/stop/restart/status firewalld.service
开机启动
# CentOS6
# 添加/删除服务到linux启动管理体系中
chkconfig --add mysqld
chkconfig --del mysqld
# 开启/关闭开机服务
chkconfig iptables on/off
# CentOS7
# 在开机时启用一个服务
systemctl enable firewalld.service
# 在开机时禁用一个服务
systemctl disable firewalld.service
# 查看服务是否开机启动
systemctl is-enabled firewalld.service
# 查看已启动的服务列表
systemctl list-unit-files|grep enabled