Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

On an RHEL6 system, I'd like my postGIS implementation (ie my postgres/postgresql databases) to use Enthought's Canopy distribution of python, rather than the built-in GNU's distribution. (This is because postGIS needs some packages that seem hard to install from RHEL's built-in repositories.)

How can I change the python path / etc just for postgres?

share|improve this question
add comment

1 Answer

There are a couple of methods to try.

Override stop/start script

In the stop/start script for PostgresSQL I would add the path to this custom version of Python. The start/stop script is here, for example: /etc/init.d/postgresql. If you add a line towards the top of this script:

export PATH=/path/to/postGIS/python:$PATH

You'll override the location that Python is used from.

Add a customization vis sysconfig

Most Red Hat services will look in the directory /etc/sysconfig for additional customizations. You could try adding the custom PATH there instead.

Create a file like this: /etc/sysconfig/pgsql/mycustompath.bash, and add the following line to it (you might need other entries as well):

export PATH=/path/to/postGIS/python:$PATH

References

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.