Services
List running service on Ubuntu
Section titled “List running service on Ubuntu”To get a list of the service on your system, you may run:
service --status-allThe output of service --status-all lists the state of services controlled by System V.
The + indicates the service is running, - indicates a stopped service. You can see this by running service SERVICENAME status for a + and - service.
Some services are managed by Upstart. You can check the status of all Upstart services with sudo initctl list. Any service managed by Upstart will also show in the list provided by service —status-all but will be marked with a ?.
ref: https://askubuntu.com/questions/407075/how-to-read-service-status-all-results
Systemd service management
Section titled “Systemd service management”Listing services
Section titled “Listing services”systemctlTo list running servicessystemctl --failedTo list failed services
Managing Targets (Similar to Runlevels in SysV)
Section titled “Managing Targets (Similar to Runlevels in SysV)”systemctl get-defaultTo find the default target for your systemsystemctl set-default <target-name>To set the default target for your system
Managing services at runtime
Section titled “Managing services at runtime”systemctl start [service-name]To start a servicesystemctl stop [service-name]To stop a servicesystemctl restart [service-name]To restart a servicesystemctl reload [service-name]To request service to reload its configurationsystemctl status [service-name]To show current status of a service
Managing autostart of services
Section titled “Managing autostart of services”systemctl is-enabled [service-name]To show whether a service is enabled on system bootsystemctl is-active [service-name]To show whether a service is currently active(running)systemctl enable [service-name]To enable a service on system bootsystemctl disable [service-name]To disable a service on system boot
Masking services
Section titled “Masking services”systemctl mask [service-name]To mask a service (Makes it hard to start a service by mistake)systemctl unmask [service-name]To unmask a service
Restarting systemd
Section titled “Restarting systemd”systemctl daemon-reload