The difference between systemd and system V init-"lin"
In redhat7, the concept of "run level" is no longer available. Linux systems have to do a lot of initialization work when starting up, such as mounting file systems and swap partitions, starting various process services, and so on, which can be regarded as a Unit. Systemd replaces the concept of run level in System V init with target. The difference is as follows:
Init runlevel systemd target name function 0runlevel0.target-poweroff.target shutdown 1runlevel1.target-rescue.target single user mode 2runlevel2.target-multi-user.target equivalent to level 33runlevel3.target-multi-user.target multi-user text interface 4runlevel4.target-multi-user.target equivalent to level 35runlevel5.target-graphical.target multi-user image interface 6runlevel6.target-reboot.target restart emergencyemergency.target emergency shell
If you need to change the default running target of the system to "multi-user, no graphics" mode, you can directly use the ln command to connect the multi-user mode target file to the / etc/systemd/system/ directory:
Ln-sf / lib/systemd/system/multi-user.target / etc/systemd/system/default.target
Use the systemctl command to manage services on redhat7, commonly used commands:
Command action systemctl start foo.service startup service systemctl stop foo.service stop service systemctl restart foo.service restart service systemctl reload foo.service reload configuration file systemctl status foo.service view service status systemctl enable foo.service boot self-start systemctl disable foo.service boot non-self-start systemctl is-enabled foo.service check whether the service is boot self-start systemctl list-unit-files-- type=service to view the startup and prohibition of services at all levels