I'm trying to eradicate FTP from our web publishing routines and have installed Mercurial on our server. I've been pushing to the live repositories for some time to various user accounts on the server, but I would like to also lock the individual server user accounts to a chrooted environment.
The problem is, when I lock an account down using chroot, the account no longer has access to the hg binary and can't perform updates.
I've copied the hg binary and various python files to directories within the chroot by referring to this article: https://www.mercurial-scm.org/wiki/OpenBsdWebDirSetup
but that's not specific to CentOS and some of the layout is a little different. I was able to fix a python error by adding a line to the user's .profile as found in this answer: Python executable not finding libpython shared library
and now at least I'm getting a response from hg, but that response is this:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "/bin/hg", line 10, in <module>
import os
ImportError: No module named os
If the libraries are in the wrong place is there anything I can put in .profile to correct it or do I have to move the files?
All the files I've got in /lib and /lib64 were created by Plesk when I switched the account the chrooted status, but I checked that all the files from the above tutorial were all present and matched my output from ldd.