Linux-服务管理

[旧]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

————————————————
版权声明:本文为CSDN博主「AsWeDo」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/aswedo/article/details/90345065

原文地址:https://www.cnblogs.com/JinweiChang/p/11750420.html