Fail if the required unit is absent or stopped.

Section: Environment, Users, Dependencies

Require another unit

ini
ini
[Unit]
Requires=postgresql.service
After=postgresql.service
Explanation

Stronger relationship than Wants.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Environment, Users, Dependencies
Load variables from EnvironmentFile
Use an external env file.
OpenIn sheetinisame section
Run service as non-root user
Specify service user and group.
OpenIn sheetinisame section
Set working directory
Run service from a specific directory.
OpenIn sheetinisame section
Start after another unit
Set ordering and dependency relationship.
OpenIn sheetinisame section
Create custom service file
Open a new service file under /etc/systemd/system.
OpenIn sheetbash1 tag match
Restart on failure
Automatic restart policy.
OpenIn sheetini1 tag match