How do I add or modify environment variables for systemd service that does not already support setting via file in /etc/sysconfig/ directory?

Solution In Progress - Updated -

Issue

  • How do I add or modify environment variables for systemd service that does not already support setting via file in /etc/sysconfig/ directory?
  • How can I change PGDATA or PGPORT for postgresql when starting via systemd?
  • How do I customize a unit file/ add a custom unit file to systemd?

Environment

Red Hat Enterprise Linux (RHEL) 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content