Skip to content
Edith

Docs

Command reference

ed machines services restart

Restarts one unit.

Output
ed machines services restart <machine> <unit> [--json]

Arguments

Name Type / values Default What it does
<machine> machine name, ssh alias or id required Which machine the unit lives on.
<unit> unit name required The unit, for example nginx.service.

Options

Name Type / values Default What it does
--json flag off Emit JSON on stdout instead of the human line.
--help, -h flag off Print the help for this command on stdout and exit 0.
Output
$ ed machines services restart devbox nginx.servicerestarted nginx.service on Devbox
JSON
{  "action": "restart",  "applied": true,  "machine": "Devbox",  "unit": "nginx.service"}
Output
ed machines services restart devbox nginx.serviceed machines devbox services restart docker.serviceed machines services restart devbox nginx.service --json

Behaviour notes

systemctl restart on a stopped unit starts it, so this is the verb to reach for when you do not care what state the unit was in. The 60 second timeout is the one to watch: a unit with a slow ExecStop can outlast it, and the command then reports a failure for something that finishes fine a moment later.

Only start, stop and restart exist. There is no enable, disable, reload, status or journal verb; for those, use the raw form, ed devbox systemctl reload nginx or ed devbox journalctl -u nginx -n 100.

Where to go next