基于 socker 的激活机制; socker 与服务程序分离
基于 d-bus 的激活机制
基于 device 的激活机制
基于 path 的激活机制
系统快照: 保存各 unit 的当前状态信息于持久存储设备中
向后兼容 sysv init 脚本
不兼容:
systemctl 命令固定不变, 不可扩展
非由 systemd 启动的服务, systemctl 无法与之通信和控制
3.5 Centos7 的引导顺序
UEFI 或 BIOS 初始化, 运行 POST 开机自检
选择启动设备
引导装载程序, CentOS 是 grub2
加载装载程序的配置文件 : /etc/grub.d/ /etc/default/grub /boot/grub2/grub.cfg
加载 initramfs 驱动模块
加载内核
内核初始化, CentOS 7 使用 systemd 代替 init
执行 initrd.target 所有单元, 包括挂载 /etc/fstab
从 initramfs 根文件系统切换到磁盘根目录
systemd 执行默认 target 配置, 配置文件 /etc/systemd/default.target /etc/systemd/system/
systemd 执行 sysinit.target 初始化系统及 basic.target 准备操作系统
systemd 启动 multi-user.target 下的本机与服务器服务
systemd 执行 multi-user.target 下的 / etc/rc.d/rc.local
systemd 执行 multi-user.target 下的 getty.target 及登入服务
systemd 执行 graphical 需要的服务
Centos7 的基本操作
4.1 配置网卡
- [[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33 #centos7 里面的网卡名称也和以前不一样了
- TYPE=Ethernet
- PROXY_METHOD=none
- BROWSER_ONLY=no
- BOOTPROTO=none
- DEFROUTE=yes
- IPV4_FAILURE_FATAL=no
- IPV6INIT=yes
- IPV6_AUTOCONF=yes
- IPV6_DEFROUTE=yes
- IPV6_FAILURE_FATAL=no
- IPV6_ADDR_GEN_MODE=stable-privacy
- NAME=ens33
- UUID=9e20bd9c-938f-4f5f-adf3-a06c617d6b5f
- DEVICE=ens33
- ONBOOT=yes
- IPADDR0=10.0.0.201
- PREFIX0=24
- GATEWAY0=10.0.0.2
- DNS1=10.0.0.2
4.2 重启网卡以及其他服务
启动: service name start ==> systemctl start name.service
停止: service name stop ==> systemctl stop name.service
重启: service name restart ==> systemctl restart name.service
状态: service name status ==> systemctl status name.service
条件式重启: service name condrestart ==> systemctl try-restart name.service
重载或重启服务: systemctl reload-or-restart name.service
重载或条件式重启服务: systemctl reload-or-try-restart name.service
禁止设定为开机自启: systemctl mask name.service
取消禁止设定为开机自启: systemctl unmask name.service
4.3 查看某服务当前是否激活的状态
查看某服务当前激活与否的状态: systemctl is-active name.service
查看所有已经激活的服务:
systemctl list-units --type service
查看所有服务:
systemctl list-units --type service --all
4.4 跟 chkconfig 命令对应关系
来源: http://www.bubuko.com/infodetail-3128569.html