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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.