service
Processes and system
Usage
service <name> <start|stop|restart|status>A thin wrapper left over from the SysV era; on a systemd machine it simply forwards to systemctl and understands fewer verbs.
Common flags
| Flag | Meaning |
|---|---|
| start / stop / restart | The three verbs that work everywhere. |
| status | Ask the service how it is doing. |
| --status-all | List every init script and its state (Debian/Ubuntu). |
Examples
sudo service nginx restartRestart a service on a machine of any vintage.
service --status-allSee every service the old init system knows about.
What is running and what is eating the machine. Identifying it comes before killing it.
How to read this
- Square brackets [ ] mark a part you may leave out.
- An ellipsis … means you can list more than one.
- Flags are case-sensitive — in some commands -r and -R do different things.
Questions
Q. What does service do?
A thin wrapper left over from the SysV era; on a systemd machine it simply forwards to systemctl and understands fewer verbs.
Q. How do I type it?
service <name> <start|stop|restart|status> — square brackets mark the parts you can leave out.
Q. How many flags are worth knowing?
3 are listed here; the full set is in man service. This command sits under Processes and system.
Related commands
man page: man service