After centos 7 minimal is installed, the system is unable to speak out and the change is huge. It is found that no common commands have been used in the past.
I. Installation of Common commands
Check the anaconda-ks.cfg, it turns out that there is no base group package
[[email protected] ~]# cat anaconda-ks.cfg #version=RHEL7# System authorization informationauth --enableshadow --passalgo=sha512# Use CDROM installation mediacdrom# Run the Setup Agent on first bootfirstboot --enableignoredisk --only-use=sda# Keyboard layoutskeyboard --vckeymap=us --xlayouts=‘us‘# System languagelang en_US.UTF-8 --addsupport=zh_CN.UTF-8# Network informationnetwork --bootproto=dhcp --device=eno16777736 --onboot=off --ipv6=autonetwork --hostname=localhost.localdomain# Root passwordrootpw --iscrypted $6$Zz5VMf1HPPRm0YRL$QSoaU9pAUApXMj9BXuK5qlUFGAfCv9Y/ylVGUcDYv.lrxfNodTiI/7DO1UR7carvL1EdgwQpuiwDt524f6.GR.# System timezonetimezone Asia/Chongqing --isUtc --nontp# System bootloader configurationbootloader --location=mbr --boot-drive=sdaautopart --type=lvm# Partition clearing informationclearpart --none --initlabel %packages@core # 这里只有core%end
[[email protected] ~]# yum groupinstall base # 安装完后ifconfig、service、chkconfig等命令就都有了
Ii. Operation-level switch
[[email protected] ~]# cat /etc/inittab # 系统运行级别的设置方式也变化了# inittab is no longer used when using systemd.## ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.## Ctrl-Alt-Delete is handled by /etc/systemd/system/ctrl-alt-del.target## systemd uses ‘targets‘ instead of runlevels. By default, there are two main targets:## multi-user.target: analogous to runlevel 3# graphical.target: analogous to runlevel 5## To set a default target, run:## ln -sf /lib/systemd/system/<target name>.target /etc/systemd/system/default.target这里写的很明白了,做个软链修改默认运行级别
[[email protected] system]# ll /lib/systemd/system/runlevel*.target # 系统0-6 7个运行级别,2 3 4 运行指向同一个文件lrwxrwxrwx 1 root root 15 Oct 11 03:51 /lib/systemd/system/runlevel0.target -> poweroff.targetlrwxrwxrwx 1 root root 13 Oct 11 03:51 /lib/systemd/system/runlevel1.target -> rescue.targetlrwxrwxrwx 1 root root 17 Oct 11 03:51 /lib/systemd/system/runlevel2.target -> multi-user.targetlrwxrwxrwx 1 root root 17 Oct 11 03:51 /lib/systemd/system/runlevel3.target -> multi-user.targetlrwxrwxrwx 1 root root 17 Oct 11 03:51 /lib/systemd/system/runlevel4.target -> multi-user.targetlrwxrwxrwx 1 root root 16 Oct 11 03:51 /lib/systemd/system/runlevel5.target -> graphical.targetlrwxrwxrwx 1 root root 13 Oct 11 03:51 /lib/systemd/system/runlevel6.target -> reboot.target
Iii. systemctl Management System Service
Systemctl can be viewed as a combination of service and chkconfig.
Job
|
Chkconfig, Service |
Systemctl |
Auto-Start Service |
Chkconfig -- level 3 httpd on |
Systemctl enable httpd |
Auto-start when the service is not started |
Chkconfig -- level 3 httpd off |
Systemctl disable httpd |
Service Status |
Service httpd status |
Systemctl status httpd (service details) Systemctl is-active httpd (only show whether it is active)
|
Startup status of all services |
Chkconfig -- list |
Systemctl list-units -- type = Service |
Start the service |
Service httpd start |
Systemctl start httpd |
Stop Service |
Service httpd stop |
Systemctl stop httpd |
Restart service |
Service httpd restart |
Systemctl restart httpd |
Centos 7 and earlier versions all adopt the sysvinit system to start the process management system. Because it is a serial process initiation process, the startup process may be affected by the blocking of a process. Centos 7 uses systemd. The goal is to start fewer processes as much as possible, and start more processes in parallel as much as possible (this is the conceptual basis for better performance than sysvinit ).
More detailed introduction of systemd https://www.huzs.net /? P = 2180
This article is from the "the-way-to-cloud" blog, please be sure to keep this source http://iceyao.blog.51cto.com/9426658/1562564
Centos 7-entry-level operations