sysvinit命令 |
systemd命令 |
说明 |
service httpd start |
systemctl start httpd.service |
启动 httpd 服务 |
service httpd stop |
systemctl stop httpd.service |
关闭 httpd 服务 |
service httpd restart |
systemctl restart httpd.service |
重启 httpd 服务,不管现在服务是启动状态还是关闭状态 |
service httpd reload |
systemctl reload httpd.service |
重新载入httpd配置信息而不中断服务 |
service httpd condrestart |
systemctl condrestart httpd.service |
也是重启 httpd 服务,但是使用 condrestart 选项时,会检查服务当前的运行状态,如果服务正在运行则重启当前服务,如果服务没有运行则 condrestart 无法重启服务 |
service httpd status |
systemctl status httpd.service |
查看 httpd 服务运行状态 |
chkconfig httpd on |
systemctl enable httpd.service |
开启 httpd 服务开机启动 |
chkconfig httpd off |
systemctl disable httpd.service |
关闭 httpd 服务开机启动 |
chkconfig httpd |
systemctl is-enable httpd.service |
检查 httpd 服务在当前环境下是开启还是关闭 |
chkconfig --list |
systemctl list-unit-files --type=service |
输出在各个运行级别下所有服务启用和禁用的情况 |
chkconfig httpd --list |
ls /etc/systemd/system/*.wants/httpd.service |
输出 httpd 服务在各个运行级别下启用和禁用的情况 |
chkconfig httpd --add |
systemctl daemon-reload |
创建一个新服务文件或者变更配置时使用 |
分类:Redhat
标签:
评论已关闭!