When created custom postgres service unit file with below extra line in unit file:
EnvironmentFile=-/path/to/env
Enable the custom unit and initialize DB:
# /usr/bin/systemctl enable custom-pg.service
# postgresql-setup --initdb --unit custom-pg --port 3333
ERROR: Can not read EnvironmentFile 'EnvironmentFiles=/path/to/env' specified
in custom-pg.service
/usr/bin/postgresql-setup: line 415: EnvironmentFiles=/path/to/env: No such file or directory
Note: Line number 415 because this was reproduced on RHEL system not on upstream scripts.
When created custom postgres service unit file with below extra line in unit file:
Enable the custom unit and initialize DB:
Note: Line number
415because this was reproduced on RHEL system not on upstream scripts.