Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
service: fix ExecStart= for Red Hat Software Collections
Historically we used `pg_ctl` in ExecStart=, which we later wrapped into postgresql-ctl script - and later we moved to /bin/postmaster directly. The postgresql-ctl script had two purposes: (a) some additional/compat logic on top of pg_ctl and (b) it enabled the software collection by `scl_source`. When we moved to ExecStart=/bin/postmaster we realized that (a) is not needed anymore but we forgot about (b). Now we got report that server fails to load modules because it doesn't have LD_LIBRARY_PATH set accordingly in Software Collections scenario. Ideally, we would wrap %_bindir/postmaster by something like %_bindir/postmaster-scl. But this would mean that we'd have to request selinux-policy change, and wait till it gets updated. So instead of shell wrapper script, invoke /bin/sh directly. The /bin/sh is symlink to /bin/bash, which has shell_exec_t label; and SELinux policy allows shell_exec_t -> postgresql_exec_t -> postgresql_t transition. This started to be an issue after sd_notify switch, done in 925b34c. Related: rhbz#1550567, rhbz#1631185
- Loading branch information