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: