HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

service — Manage services by running init scripts. The full script path should be omitted (`/etc/init.d/` is a

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandservicesinitclimanagerunningservicescripts
linux

Problem

How to use the service command: Manage services by running init scripts. The full script path should be omitted (/etc/init.d/ is assumed). More information: <https://manned.org/service>.

Solution

service — Manage services by running init scripts. The full script path should be omitted (/etc/init.d/ is assumed). More information: <https://manned.org/service>.

List the name and status of all services:
service --status-all


Start/Stop/Restart/Reload service (start/stop should always be available):
service {{service_name}} {{start|stop|restart|reload}}


Do a full restart (runs script twice with start and stop):
service {{service_name}} --full-restart


Show the current status of a service:
service {{service_name}} status

Code Snippets

List the name and status of all services

service --status-all

Start/Stop/Restart/Reload service (start/stop should always be available)

service {{service_name}} {{start|stop|restart|reload}}

Do a full restart (runs script twice with start and stop)

service {{service_name}} --full-restart

Show the current status of a service

service {{service_name}} status

Context

tldr-pages: linux/service

Revisions (0)

No revisions yet.