I'm trying to install a program that uses Durus on a server. It
appears that if a Python program uses eggs, it creates a
~/.python-eggs/ directory, so the home directory must be writeable.
This conflicts with server environments where you want to run a daemon
with minimum privileges. Second, it appears to use the real user ID
rather than the effective user ID to choose the home directory. In
this case I'm trying to use start-stop-daemon on Linux to start my
Python program, switching from user 'root' to user 'apache'.
# start-stop-daemon --start --chuid apache:apache --make-pidfile
--pidfile /var/run/cameo.pid --exec
/var/www/apps/cameo/bin/cameo_server.py --
Traceback (most recent call last):
File "/var/www/apps/cameo/bin/cameo_server.py ", line 3, in ?
from durus.client_st orage import ClientStorage
File "build/bdist.linux-i686/egg/durus/client_storage. py", line 7, in
?
File "build/bdist.linux-i686/egg/durus/serialize.py", line 9, in ?
File "build/bdist.linux-i686/egg/durus/persistent.py", line 15, in ?
File "build/bdist.linux-i686/egg/durus/_persistent.py" , line 7, in ?
File "build/bdist.linux-i686/egg/durus/_persistent.py" , line 4, in
__bootstrap__
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 799, in resource_filena me
return get_provider(pa ckage_or_requir ement).get_reso urce_filename(
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 1187, in get_resource_fi lename
self._extract_r esource(manager , self._eager_to_ zip(name))
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 1204, in _extract_resour ce
real_path = manager.get_cac he_path(self.eg g_name,
self._parts(zip _path))
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 836, in get_cache_path
ensure_director y(target_path)
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 2301, in ensure_director y
os.makedirs(dir name)
File "/usr/lib/python2.4/os.py", line 156, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.4/os.py", line 156, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.4/os.py", line 159, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/root/.python-eggs'
Can I make it use a different eggs directory? Any other idea how to
install a program using eggs on a server?
BTW, Python is Gentoo's /usr/bin/python 2.4.2. The eggs are installed
in /usr/local/lib/python2.4 to prevent them from mixing with Gentoo
packages in /usr/lib.
--Mike <sluggoster@gma il.com>
appears that if a Python program uses eggs, it creates a
~/.python-eggs/ directory, so the home directory must be writeable.
This conflicts with server environments where you want to run a daemon
with minimum privileges. Second, it appears to use the real user ID
rather than the effective user ID to choose the home directory. In
this case I'm trying to use start-stop-daemon on Linux to start my
Python program, switching from user 'root' to user 'apache'.
# start-stop-daemon --start --chuid apache:apache --make-pidfile
--pidfile /var/run/cameo.pid --exec
/var/www/apps/cameo/bin/cameo_server.py --
Traceback (most recent call last):
File "/var/www/apps/cameo/bin/cameo_server.py ", line 3, in ?
from durus.client_st orage import ClientStorage
File "build/bdist.linux-i686/egg/durus/client_storage. py", line 7, in
?
File "build/bdist.linux-i686/egg/durus/serialize.py", line 9, in ?
File "build/bdist.linux-i686/egg/durus/persistent.py", line 15, in ?
File "build/bdist.linux-i686/egg/durus/_persistent.py" , line 7, in ?
File "build/bdist.linux-i686/egg/durus/_persistent.py" , line 4, in
__bootstrap__
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 799, in resource_filena me
return get_provider(pa ckage_or_requir ement).get_reso urce_filename(
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 1187, in get_resource_fi lename
self._extract_r esource(manager , self._eager_to_ zip(name))
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 1204, in _extract_resour ce
real_path = manager.get_cac he_path(self.eg g_name,
self._parts(zip _path))
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 836, in get_cache_path
ensure_director y(target_path)
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 2301, in ensure_director y
os.makedirs(dir name)
File "/usr/lib/python2.4/os.py", line 156, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.4/os.py", line 156, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.4/os.py", line 159, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/root/.python-eggs'
Can I make it use a different eggs directory? Any other idea how to
install a program using eggs on a server?
BTW, Python is Gentoo's /usr/bin/python 2.4.2. The eggs are installed
in /usr/local/lib/python2.4 to prevent them from mixing with Gentoo
packages in /usr/lib.
--Mike <sluggoster@gma il.com>
Comment