Systemctl & amp; systemd

Source: Internet
Author: User

Systemctl & systemd documents

Systemctl & systemd documents

1. Script directory:
/Usr/lib/systemd/
2. service configuration file directory (automatically started upon startup ):
/Usr/lib/systemd/system
3. service files
Service Format:
*. Service
Service file format:
[Unit] // user service description
Description = xxx // Description Service
After = xxx // describe the service category
[Service] // specific Service running parameters
Type = forking // The service is running in the background.
PIDFile =/path/pid // PID path
ExecStart = // commands and parameters for running the service (absolute path)
ExecReload = // command and parameter for service restart (absolute path)
ExecStop = // command and parameter for stopping a service (absolute path)
PrivateTmp = True // assign an independent temporary space for the service
[Install] // service installation Configuration

4. Service Usage

Systemctl start [service file name]
Systemctl restart [service file name]
Systemctl stop [service file name]
Systemctl status [service file name]

5. Related commands
New commands of old task commands
Enable a service to automatically start chkconfig -- level 3 httpd on systemctl enable httpd. service
So that a service does not automatically start chkconfig -- level 3 httpd off systemctl disable httpd. service
Check service status service httpd status systemctl status httpd. service (service details) systemctl is-active httpd. service (only show whether it is Active)
Show all started services chkconfig -- list systemctl list-units -- type = service
Start a service httpd start systemctl start httpd. service
Stop a service httpd stop systemctl stop httpd. service
Restart a service httpd restart systemctl restart httpd. service

See original article:

Systemctl User Guide: Comparison between CentOS 7.x systemd and CentOS 6.x daemon

Full guide to systemctl commands

Usage of systemctl on CentOS 7

This article permanently updates the link address:

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.