A, systemctl commonly used commands
systemctl list-units ## are listed in the current system status of the service
systemctl list-unit-files ## lists switched services
systemctl status sshd ## to view the specified service status
systemctl stop sshd ## closes the specified service
systemctl start sshd ## to open the specified service
systemctl restart sshd ## restart the service
systemctl enable sshd ## to set the specified service boot open
systemctl disable sshd ## to set the specified service boot closed
systemctl reload sshd ## the designated service from the new load configuration
systemctl list-dependencies sshd ## to view the specified service dependent relationship
systemctl mask sshd ## freeze the specified service
systemctl unmask sshd ## enable the service
two: service commonly used commands
service --status-all list for all services of the current state of
sevice network status displays the current list of network interfaces and devices.
sevice network start / stop / restart where the restart command can also be used to start or stop any other service.
Start, stop or restart network services, essentially performing all network script / etc / sysconfig / network-scrīpts / under
service command is used to manage system services, such as start (Start) , stop (STOP) , reboot (restart) , view the status (status) and so on. The order also includes related chkconfig , ntsysv , etc., chkconfig for viewing, set to run level of service, ntsysv easy and intuitive settings for each service is started automatically. service command itself is a shell script that looks for the specified service script in /etc/init.d/ directory and call the service script to complete the task.
1. Command Format:
service SCRIPT COMMAND [OPTIONS]
service [service] [Operation] [options]
2. Command functions:
service command to start, stop, restart and shut down the system. They can also display the current status of all system services.
3. Common parameters:
1) status
2) start
3) stop
4) reload
5) disable
6) force-reload
4. Common mode:
Format: service <service>
Description: Specifies the print service <service> command line use help.
Format: service <service> start
Description: Starts the specified system service <service>
Format: service <service> stop
Description: Stops the specified system service <service>
Format: service <service> restart
Description: Restart the specified system service < service>, which is to stop (stop), then start (start).
Format: chkconfig --list
Description: View a list of system services and run levels for each service.
Format: chkconfig <service> on
Description: set to start automatically when the specified service <service> boot.
Format: chkconfig <service> off
Description: Sets the specified service <service> does not start automatically at boot time.
Format: ntsysv
Description: Whether to start automatically at boot time to full-screen text interface settings service.