CentOS 7.0 Systemd

Source: Internet
Author: User

CentOS 7 has switched to SYSTEMD and the system instructions have changed. Services that were previously used to start, restart, and stop the service as backward-compatible instructions can also be used, but may disappear in the future. At the same time, Chkconfig also changed into a systemctl. Here are some common new systemctl directives that correspond to service and chkconfig.

Service directives are still available in the current CentOS 7 (or RHEL 7) system. For example

[Email protected] ~]# service network restart

Restarting network (via Systemctl): [OK]

[Email protected] ~]# service httpd restart

Redirecting To/bin/systemctl restart Httpd.service

[[Email protected] ~]# service sshd restart

Redirecting To/bin/systemctl restart Sshd.service

However, the system will automatically redirect the instruction to the new instruction/bin/systemctl to execute and give a hint.

It's time to switch to the new instruction format and use Systemctl directly. This command means the system Contrl. Here are some common examples:

Start the service:

Systemctl Start httpd

Stop service:

Systemctl Stop httpd

Restart Service (stop first, start later):

Systemctl Restart httpd

Reload (with new configuration file):

Systemctl Reload httpd

Show Service Status:

Systemctl Status httpd

At the same time, previously used to set the system start automatically run a service instructions Chkconfig also changed, or with Systemctl.

Chkconfig Service on

Changed it,

Systemctl Enable httpd

Chkconfig Service off

Changed it,

Systemctl Disable httpd

Check the status of the service

Chkconfig Service

Changed it,

Systemctl is-enabled httpd

List the instructions for all the services,

Chkconfig–list

Changed it,

Systemctl List-unit-files--type=service

–levels, who used to specify the service RunLevel, is gone. adapt to it slowly.

CentOS 7.0 Systemd

Related Article

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.