Linux 管理服务的两种方式
centos6 上的service与centos7 上的systemctl管理系统服务的命令
·
[旧]System V init 初始化进程服务(service 与 chkconfig命令)
- 启动/停止/重启服务
service [servicename] [start|stop|restart] - 重新加载服务配置文件(不重启服务)
service [servicename] [reload] - 查看服务状态
service [servicename] status - 设置/禁止服务开机自动启动
chkconfig [servicename] [on|off] - 查看服务是否是开机自动启动
chkconfig foo - 查看各个启动级别下服务的开机自动启动与禁用情况
chkconfig --list
而RH7用Systemd初始化进程服务(systemctl命令,可视为service与chkconfig命令的组合体)替换了较为“古老”的System V init 初始化进程服务。需要注意的是:Systemd中,服务名大都以“.service”结尾,一般在System V init 中的服务名加上“.service”就是在Systemd中的服务名
[新]Systemd 初始化进程服务
- 启动/停止/重启服务
systemctl [start|stop|restart] [servicename] - 重新加载服务配置文件(不重启服务)
systemctl [reload] [servicename] - 查看服务状态
systemctl status [servicename] - 设置/禁止服务开机自动启动
systemctl [enable|disable] [servicename] - 查看服务是否是开机自动启动
systemctl is-enabled [servicename] - 查看各个启动级别下服务的开机自动启动与禁用情况
systemctl list-unit-files
更多推荐
已为社区贡献1条内容
所有评论(0)