用systemctl切换模式
设置开机默认的启动方式
[root@study ~]# systemctl set-default multi-user.target
[root@study ~]# systemctl get-default
切换启动方式
图形切换终端
[root@study ~]# systemctl isolate multi-user.target 对应原来的init 3
终端切换图形
[root@study ~]# systemctl isolate graphical.target 对应原来的init 5
救援模式
[root@study ~]# systemctl rescue 强制进入救援模式 对应原来的init 1 单用户模式
服务存在的路径
一般自己安装的服务建议在这个目录下
/etc/systemd/system
系统安装的服务在
/usr/lib/systemd/system/
服务与端口的对应
/etc/services
设置开机启动/不启动
[root@study ~]# systemctl disable chronyd.service
查看所有的服务
[root@study ~]#systemctl 查看所有启动的服务
[root@study ~]# systemctl list-unit-files 查看所有安装的Unit
systemctl list-units --type=target --all 只查看所有安装的service unit
查看服务的依赖性
systemctl list-dependencies graphical.target