Bug 1486089

Summary: CentOS 7 / Postgresql 9.5.7 Software Collections $XDG_DATA_DIRS side effect
Product: [Community] softwarecollections.org Reporter: Matt C. <mypluribus>
Component: rh-postgresql95Assignee: Petr Kubat <pkubat>
Status: CLOSED DUPLICATE QA Contact: Databases Maintanance List <databases-maint>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0CC: praiskup
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-29 07:49:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matt C. 2017-08-29 01:08:17 UTC
Description of problem:

When using software collections to install postgresql, and sourcing /opt/rh/rh-postgresql95/enable the XDG_DATA_DIRS environment variable is overwritten and causes graphical login to malfunction.

According to documentation here: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

If $XDG_DATA_DIRS is either not set or empty, a value equal to /usr/local/share/:/usr/share/ should be used. 

However, the enable script concatenates an empty string w/ the path /opt/rh/rh-postgresql95/root/usr/share ... causing GNOME desktop to ignore /usr/share.

This issue is not likely to affect production systems w/o graphic login. (I found the issue in a development environment)

Version-Release number of selected component (if applicable): 9.5.7


How reproducible:


Steps to Reproduce:

1. Install CentOS 7 w/ minimal desktop as follows: 

yum -y update

yum -y groupinstall "X Window System"
yum -y install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts

unlink /etc/systemd/system/default.target
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target


2. Next install postgres w/ software collections

yum -y install centos-release-scl centos-release-scl-rh
yum -y install rh-postgresql95-postgresql-server rh-postgresql95

3. Create /etc/profiles.d/rh-postgresql95.sh

#!/bin/bash

source /opt/rh/rh-postgresql95/enable
export X_SCLS="`scl enable rh-postgresql95 'echo $X_SCLS'`"

4. Fix permissions

chmod 644 /etc/profiles.d/rh-postgresql95.sh

5. reboot

Actual results:

Graphical login for all users will fail

Expected results:

Graphical login for all users succeeds

Additional info:

The following fix allows graphical login to succeed ... however I'm not sure of side effects...

sed -i 's/^export XDG_DATA_DIRS/#export XDG_DATA_DIRS/' /opt/rh/rh-postgresql95/enable

Comment 1 Pavel Raiskup 2017-08-29 07:49:09 UTC
Thanks for the report, your work-around seems to be correct.  See the duplicate
bug.

*** This bug has been marked as a duplicate of bug 1464084 ***