CentOS7使用笔记

启动工具

在CentOS7中用的全新服务启动管理器 systemctl

在CentOS6做服务的启停用service

systemctl 代替service+chkconfig

服务启动相关的文件: /etc/rc.d/init.d/ /etc/init.d

在CentOS6中只需要把启动的服务文件放到/etc/ini.d目录下就可以了,但是在CentOS7中怎么处理了?

查看服务列表状态:
systemctl list-units --type=service

systemctl list-unit-files

开启自启动服务: systemctl enable mysqld

开启禁止启动服务: systemctl disable mysqld

查看开机启动: systemctl is-enabled mysqld

启用服务就是在当前“runlevel”的配置文件目录 /etc/systemd/system/multi-user.target.wants 里,建立 /usr/lib/systemd/system 里面对应服务配置文件的软链接;

禁用服务就是删除此软链接,添加服务就是添加软连接。

/etc/systemd/system/multi-user.target.wants

/usr/lib/systemd/system

https://www.cnblogs.com/devilmaycry812839668/p/8481760.html

启动默认为命令行模式

修改文件 /etc/inittab id:3:initdefault:

防火墙

systemctl stop firewalld # 临时关闭防火墙
systemctl disable firewalld # 禁止开机启动

与CentOS6的区别

https://www.cnblogs.com/diantong/p/9597882.html

https://www.cnblogs.com/bethal/p/5945026.html

posted @ 2019-06-17 15:19  ncsb  阅读(128)  评论(0编辑  收藏  举报