在CentOS7中用的全新服务启动管理器 systemctlhtml
在CentOS6作服务的启停用servicemysql
systemctl 代替service+chkconfigsql
服务启动相关的文件: /etc/rc.d/init.d/ /etc/init.dcentos
在CentOS6中只须要把启动的服务文件放到/etc/ini.d目录下就能够了,可是在CentOS7中怎么处理了?工具
查看服务列表状态:
systemctl list-units --type=service命令行
systemctl list-unit-fileshtm
开启自启动服务: systemctl enable mysqldblog
开启禁止启动服务: systemctl disable mysqldget
查看开机启动: systemctl is-enabled mysqldit
启用服务就是在当前“runlevel”的配置文件目录 /etc/systemd/system/multi-user.target.wants 里,创建 /usr/lib/systemd/system 里面对应服务配置文件的软连接;
禁用服务就是删除此软连接,添加服务就是添加软链接。
/etc/systemd/system/multi-user.target.wants
/usr/lib/systemd/system
http://www.javashuo.com/article/p-ygbkdxbq-gt.html
修改文件 /etc/inittab id:3:initdefault:
systemctl stop firewalld # 临时关闭防火墙
systemctl disable firewalld # 禁止开机启动