service
Linux · System · reference only
What it does
Starts, stops and queries services using the classic syntax. On systems with systemd it forwards the commands to systemctl.
Syntax
service servicio orden service --status-all
Options and parameters
startStarts the service.
stopStops the service.
restartStops and starts the service again.
reloadAsks the service to reread its configuration without stopping.
statusShows whether the service is running.
--status-allLists all known services with their status.
Usage examples
sudo service ssh statusChecks whether the SSH server is running.
sudo service nginx restartRestarts the nginx web server.
service --status-allLists the services and marks the active ones.
sudo service apache2 stopStops the Apache server.
Notes and common mistakes
- On modern distributions systemctl is preferable, as it gives more information and control.
- Service names are the scripts in /etc/init.d/ or the systemd units.