In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "the usage of systemctl command in CentOS7". In daily operation, I believe many people have doubts about the usage of systemctl command in CentOS7. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "the usage of systemctl command in CentOS7". Next, please follow the editor to study!
Linux Systemctl is a collection of system management daemons, tools, and libraries to replace the System V, service, and chkconfig commands. The initial process is mainly responsible for controlling the systemd system and service manager. Through Systemctl-help, we can see that the command is mainly divided into: query or send control commands to systemd service, management unit service commands, service file related commands, task, environment, snapshot related commands, systemd service configuration overload, system boot and shutdown related commands.
1. List all available units systemctl list-unit-files2. List all running units systemctl list-units3. List all failed units systemctl-failed4. Check whether a unit, such as crond.service, has systemctl is-enabled crond.service5 enabled. List all services systemctl list-unit-files-type=service6. How to start, restart, stop, reload services and check the status of services (such as httpd.service) systemctl start httpd.servicesystemctl restart httpd.servicesystemctl stop httpd.servicesystemctl reload httpd.servicesystemctl status httpd.service in Linux
Note: when we use the start,restart,stop and reload commands of systemctl, the terminal will not output anything, only the status command can print out.
7. How to activate the service and enable or disable the service (that is, automatically start the mysql.service service when the system starts) systemctl is-active mysql.servicesystemctl enable mysql.servicesystemctl disable mysql.service8. How to block (make it unable to start) or display services (such as ntpdate.service) systemctl mask ntpdate.serviceln-s / dev/null / etc/systemd/system/ntpdate.servicesystemctl unmask ntpdate.servicerm / etc/systemd/system/ntpdate.service9. Use the systemctl command to kill the service systemctl kill crond10. List all system mount points systemctl list-unit-files-type=mount11. Mount, unmount, remount, reload the system mount point and check the mount point status systemctl start tmp.mountsystemctl stop tmp.mountsystemctl restart tmp.mountsystemctl reload tmp.mountsystemctl status tmp.mount12. Activate, enable, or disable the mount point (mount automatically when the system starts) systemctl is-active tmp.mountsystemctl enable tmp.mountsystemctl disable tmp.mount13. Mask (disable it) or visible mount point systemctl mask tmp.mountln-s / dev/null / etc/systemd/system/tmp.mountsystemctl unmask tmp.mountrm / etc/systemd/system/tmp.mount14 in Linux. List all available system sockets systemctl list-unit-files-type=socket15. Check all the configuration details of a service systemctl show mysql16. Get a list of dependencies for a service (httpd) systemctl list-dependencies httpd.service17. Exe. Start rescue mode systemctl rescue18. Enter emergency mode systemctl emergency19. Lists the currently used runlevel systemctl get-default20. Start run level 5, that is, graphic mode systemctl isolate runlevel5.target
Or
Systemctl isolate graphical.target21. Start runlevel 3, that is, multi-user mode (command line) systemctl isolate runlevel3.target
Or
Systemctl isolate multiuser.target22. Set the multi-user mode or graphics mode to the default run level systemctl set-default runlevel3.targetsystemctl set-default runlevel5.target23. Restart, stop, suspend, hibernate, or put the system into mixed sleep systemctl rebootsystemctl haltsystemctl suspend systemctl hibernatesystemctl hybrid-sleep
For those who do not know what the level of operation is, the explanation is as follows.
Runlevel 0: shut down system Runlevel 1: rescue, maintenance mode Runlevel 3: multi-user, no graphics system Runlevel 4: multi-user, no graphics system Runlevel 5: multi-user, graphical system Runlevel 6: shut down and restart the machine at this point, the study of "the usage of the systemctl command in CentOS7" is over, hoping to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.