linux systemctl

systemctl is-enabled *.service #Query whether the service is started at boot

systemctl enable *.service #Start running the service

systemctl disable *.service #Cancel startup operation

systemctl start *.service #Start service

systemctl stop *.service #Stop the service

systemctl restart *.service #Restart the service

systemctl reload *.service #Reload the service configuration file

systemctl status *.service #Query service running status

systemctl --failed #Display services that failed to start

Note: * represents the name of a service, for example, the service name of http is httpd

 

 

Docker centos7.x runs the systemctl command abnormally

$ systemctl status firewalld.service

Failed to get D-Bus connection: Operation not permitted

Solution:

docker run -itd --privileged --name docker-centos centos:latest /usr/sbin/init

 

$ systemctl start firewalld.service

Failed to start firewalld.service: Unit not found

Solution:

$ yum install firewalld 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326267411&siteId=291194637