LinuxCommandLibrary

service

TLDR

List the name and status of all services

$ service --status-all
copy
Start/Stop/Restart/Reload a service
$ service [service_name] [start|stop|restart|reload]
copy
Do a full restart (runs script twice with stop and start)
$ service [service_name] --full-restart
copy
Show the current status of a service
$ service [service_name] status
copy

SYNOPSIS

service script command [options]
service --status-all

DESCRIPTION

service is a wrapper for init scripts in /etc/init.d/, providing a consistent interface to manage SysV init services. It automatically handles environment sanitization and path normalization for init script execution.
On systemd systems, service typically redirects commands to systemctl for backward compatibility. It remains useful for managing traditional init scripts and provides a familiar interface for administrators.

PARAMETERS

--status-all

List status of all services
script
Service name (script in /etc/init.d/)
start
Start the service
stop
Stop the service
restart
Stop and start the service
reload
Reload service configuration
status
Show service status
--full-restart
Perform full stop then start sequence

CAVEATS

On systemd systems, systemctl is preferred. Not all init scripts implement all commands (reload may not be available). The service command requires root privileges for most operations.

HISTORY

Introduced in Debian and adopted by other distributions as a standard interface for SysV init scripts. With the transition to systemd, service became a compatibility wrapper that translates commands to systemctl where appropriate.

SEE ALSO

Copied to clipboard