$linuxjunkies
>

service(8)

Run a System V init script or manage systemd services for system daemons.

UbuntuDebianFedoraArch

Synopsis

service <service-name> <command> [options]

Description

The service command is used to run System V init scripts located in /etc/init.d/ or, on systemd systems, to control systemd services. It provides a consistent interface for starting, stopping, and managing background services and daemons without needing to know the full path to init scripts.

On modern systemd-based distributions, service acts as a wrapper that translates commands to systemctl. On older init systems, it directly executes the init script with the given command.

Common options

FlagWhat it does
--status-allShow status of all services (uses init.d scripts)
--helpDisplay help information

Examples

Start the nginx web server service

service nginx start

Stop the MySQL database service

service mysql stop

Restart the SSH daemon service

service sshd restart

Check the current status of Apache web server

service apache2 status

List status of all services managed by init.d

service --status-all

Reload PostgreSQL configuration without stopping the service

service postgresql reload

Related commands