Line 45: |
Line 45: |
| | | |
| To be able to do this, we need to create a file as described below, which is the postgresql way of settings variables: | | To be able to do this, we need to create a file as described below, which is the postgresql way of settings variables: |
− | mkdir -p /opt/rh/postgresql92/root/etc/sysconfig/pgsql | + | mkdir -p /opt/rh/rh-postgresql92/root/etc/sysconfig/pgsql |
− | echo PGDATA=/home/e-smith/files/pgsql/data > /opt/rh/postgresql92/root/etc/sysconfig/pgsql/postgresql92-postgresql | + | echo PGDATA=/home/e-smith/files/pgsql/data > /opt/rh/rh-postgresql92/root/etc/sysconfig/pgsql/postgresql92-postgresql |
| | | |
| {{Note box|Just like MySQL, Postgresql needs pre-backup and pre-restore actions. New actions have to developed to make this possible. Once this is the case, the databases location will have to change to the default /var/lib/pgsql}} | | {{Note box|Just like MySQL, Postgresql needs pre-backup and pre-restore actions. New actions have to developed to make this possible. Once this is the case, the databases location will have to change to the default /var/lib/pgsql}} |
Line 53: |
Line 53: |
| ====Initialize database==== | | ====Initialize database==== |
| PostgreSQL requires the initialization of the database environment. This can be done by the following command: | | PostgreSQL requires the initialization of the database environment. This can be done by the following command: |
− | /etc/rc.d/init.d/postgresql92-postgresql initdb | + | /etc/rc.d/init.d/rh-postgresql92-postgresql initdb |
− | | |
| | | |
| ====Start/Stop PostgreSQL as a system service==== | | ====Start/Stop PostgreSQL as a system service==== |
Line 73: |
Line 72: |
| signal-event remoteaccess-update | | signal-event remoteaccess-update |
| You can toggle between private and public access followed by the remoteaccess-update command. | | You can toggle between private and public access followed by the remoteaccess-update command. |
− |
| |
| | | |
| ===Enable the postgresql92 environment at boot time=== | | ===Enable the postgresql92 environment at boot time=== |
Line 82: |
Line 80: |
| export X_SCLS="`scl enable postgresql92 'echo $X_SCLS'`" | | export X_SCLS="`scl enable postgresql92 'echo $X_SCLS'`" |
| | | |
− | This will take effect after a reboot, or you can run the script manually at this time to set the environment variables. | + | This will take effect after a logout/login as root or reboot. The simplest way is to log out from the console at this time and login again as root. |
| | | |
| | | |
Line 112: |
Line 110: |
| To remove the scl postgresql92 environment: | | To remove the scl postgresql92 environment: |
| /etc/rc.d/init.d/postgresql92-postgresql stop | | /etc/rc.d/init.d/postgresql92-postgresql stop |
− | yum remove postgresql92* | + | yum remove \ |
| + | postgresql92* audit-libs-python libcgroup \ |
| + | libselinux-python libsemanage-python \ |
| + | policycoreutils-python setools libs setools-libs-python |
| config delete postgresql92-postgresql | | config delete postgresql92-postgresql |
| rm -f /etc/profile.d/enablepostgresql92.sh | | rm -f /etc/profile.d/enablepostgresql92.sh |