CentOS 7 systemd command

Source: Internet
Author: User

CentOS 7 systemd command

CentOS 7The system commands have been switched to systemd. Previously Used to start, restart, and stop various servicesserviceIt can be used as backward compatible commands, but may disappear in the future. At the same time,chkconfigChangedsystemctl. Some common examples are as follows:serviceAndchkconfigNewsystemctlCommand.

In the current CentOS 7 (or RHEL 7) systemserviceCommand. For example,

[root@localhost ~]# service network restart Restarting network (via systemctl): [ OK ] [root@localhost ~]# service httpd restart Redirecting to /bin/systemctl restart httpd.service [root@localhost ~]# service sshd restart Redirecting to /bin/systemctl restart sshd.service

However, the system automatically redirects the command to the new command./bin/systemctlAnd give a prompt.

It's time to switch to the new instruction format.systemctlRight. This command indicates system contrl. Below are some common examples:

Start the service:

systemctl start httpd

Stop Service:

systemctl stop httpd

Restart the Service (stop first and then start ):

systemctl restart httpd

Reload (use the new configuration file ):

systemctl reload httpd

Display service status:

systemctl status httpd

At the same time, commands used to set automatic running of a service during system startupchkconfigAlso changed, or usedsystemctl.

chkconfig service on

Changed,

systemctl enable httpd
chkconfig service off

Changed,

systemctl disable httpd

Check the service status

chkconfig service

Changed,

systemctl is-enabled httpd

List the commands of all services,

chkconfig –list

Changed,

systemctl list-unit-files --type=service

The-levels that can previously specify the service runlevel does not exist. Take it easy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.