1. Systemctl和service、chkconfig命令的关系
systemctl命令:是一个systemd工具,主要负责控制systemd系统和服务管理器。
service命令:可以启动、停止、重新启动和关闭系统服务,还可以显示所有系统服务的当前状态。
chkconfig命令:是管理系统服务(service)的命令行工具。所谓系统服务(service),就是随系统启动而启动,随系统关闭而关闭的程序。
systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起。
systemctl是RHEL 7 的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。可以使用它永久性或只在当前会话中启用/禁用服务。
所以systemctl命令是service命令和chkconfig命令的集合和代替。
2. systemctl 管理服务的启动、重启、停止、重载、查看状态等常用命令区分
service foo start systemctl start foo.service 启动服务
service foo restart systemctl restart foo.service 重启服务
service foo stop systemctl stop foo.service 停止服务
service foo reload systemctl reload foo.service 重新加载配置文件(不终止服务)
service foo status systemctl status foo.service 查看服务状态
3. systemctl 设置服务开机启动、不启动、查看各级别下服务启动状态等常用命令
chkconfig foo on systemctl enable foo.service 开机自动启动
chkconfig foo off systemctl disable foo.service 开机不自动启动
chkconfig foo systemctl is-enabled foo.service 查看特定服务是否为开机自动启动
chkconfig --list systemctl list-unit-files --type=service 查看各个级别下服务的启动与禁用情况
4. mysql 和 mysqld 的区别
mysql 是个命令行程序;mysqld 是服务。
linux 系统里一般的服务都是以 d 结尾的,比如 httpd,vsftpd 等等。
d 的全拼应该是 daemon,也就是守护程序的意思,常驻于后台。
5. mysqld:未被识别的服务(解决方法)
6. Linux系统中的运行级别
注:
参考:
Linux下systemctl命令和service、chkconfig命令的区别
Centos7下的systemctl命令与service和chkconfig