Linux systemctl command
The
Syntax
systemctl [OPTION] [SERVICE]
For this tutorial, All commands are written to show the service management of mysql service on Linux system. Where you can use
Start and Stop Service
Use these options to start and stop any service using systemctl.
sudo systemctl start mysql .servicesudo systemctl stop mysql .service
Restart or Reload Service
Use this to reload or restart any service. It also provides reload-or-restart to restart service if reload is not available for any service.
sudo systemctl reload mysql .servicesudo systemctl restart mysql .servicesudo systemctl reload-or-restart mysql .service
Status of Service
Use this to check the status of any service.
sudo systemctl status mysql .service
Enable or Disable Service
Use this to enable or disable any service on your system. The enabled service autostarts on system boot. This is the similar option for systemd than chkconfig for the SysV init.
sudo systemctl enable mysql .servicesudo systemctl disable mysql .service
Check Service is Enabled or Disabled
Use this to check if any service is currently active or enabled.
sudo systemctl is-active mysql .servicesudo systemctl is-enabled mysql .service