rhel7设置运行级别
systemctl使用目标取代了运行级别的概念
6 7
initsystemd
init0 àsystemctlpoweroff关机
init1 àsystemctlisolaterescue.target单用户
init3 àsystemctlisolatemulti-user.target字符界面
init5 àsystemctlisolategraphical.target图形化
init6 àsystemctlreboot重启
打开/etc/inittab 修改文件的内容将不再起作用
systemd使用target而不是运行级,默认情况下,有两个主要target
multi-user.target:类似于运行级别3
graphical.target:类似于运行级5
切换运行级别
systemctl isolate multi-user.target
rhel 7中grup引导配置
主配置文件
/boot/grub2/grub.cfg直接修改,换一个内核,之前的配置失效
/etc/default/grub默认修改
然后使用grub2-mkconfig命令生效。
vim /boot/grub2/grub.cfg
GRUB_TIMEOUT="5"->设置进入默认启动项的等候时间,默认值5秒,按自己需要修改
选择菜单的显示时间,默认是5,值是0表示不显示菜单选项,值是-1表示无限期的等待,直到用户
做出选择
安装httpd服务,设置为开机自启动
yum -y install httpd
systemctl enable httpd
systemctl disable httpd
启动\关闭httpd
systemctl start httpd
systemctl stop httpd
列出所有启动项
[root@localhost ~]# systemctl list-unit-files --type service
查看资源使用情况
[root@localhost ~]# systemd-cgtop
按c cpu使用率高到低排序
p 程序排序
m内存排序
t任务排序