rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rdiff-backup-users] rdiff-backup on osx


From: Andrew Ferguson
Subject: Re: [rdiff-backup-users] rdiff-backup on osx
Date: Thu, 28 Jun 2007 10:45:58 -0400
User-agent: Thunderbird 1.5.0.12 (Macintosh/20070509)

aurbain wrote:
> Christopher Bort wrote:
>> On 06/27/07 14:36, address@hidden (aurbain) wrote:
>>
>>> I've installed librsync from source and installed rdiff-backup.
>>>
>>> `which rdiff-backup` says there isnt one.
>>
>> So the rdiff-backup binary is not in your $PATH.
> 
> would you run `which rdiff-backup` and post the path and perhaps the 
> contents of the file.  I'd bet its not a binary.

That's correct. Like for most python programs, it is simply a short
python script to load the appropriate modules and start them in a sane way.

>>> If I run python /SystemLibrary/Frameworks......./rdiff-backup it runs 
>>> as expected.  Where is the wrapper program that gets invoked by ssh?
>>
>> Is rdiff-backup really somewhere in /System/Library/Frameworks? That's 
>> a very bad place for it to be. You should never put anything in 
>> /System in OS X. That's for Apple to put things that relate to the, 
>> um, operating system. Either install rdiff-backup in a directory that 
>> is in your $PATH or add the directory it's in to your $PATH. I'd 
>> suggest using either fink (<http://www.finkproject.org/>) or 
>> Darwinports (<http://darwinports.com/>) to install rdiff-backup.
>>
> Um, rdiff-backup is a python app which gets installed in the python 
> directory when you run `python setup.py install`. 
> 
> As my production macs have never seen the internet, this is not an 
> option for me.  Would *love* to have a step-by-step for compiling and 
> installing from source.

Right. rdiff-backup simply installs using the standard Python installer
system, known as distutils. All Python modules install in this way. This
guide, Installing Python Modules for System Administrators might be very
helpful:
http://docs.python.org/inst/inst.html
Section 4 will probably interest you the most.

The 'rdiff-backup' (and 'rdiff-backup-statistics') scripts get installed
in what Python considers the default scripts directory. By convention,
this is PREFIX+/bin where PREFIX is the value of the global Python
variable 'sys.prefix'. Python assumes that your system is configured to
have PREFIX+/bin in the users' $PATH.

What's going on here is that Apple gave it's python a setup
non-conducive to users installing add-on modules. For Apple's python,
the value of PREFIX is:
'/System/Library/Frameworks/Python.framework/Versions/2.3'

as we can see from:

$ python
Python 2.3.5 (#1, Mar 20 2005, 20:38:20)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.prefix
'/System/Library/Frameworks/Python.framework/Versions/2.3'
>>> ^D

So for Apple to play nicely, they would have either added
/System/Library/Frameworks/Python.framework/Versions/2.3/bin to the
default $PATH, or they could have created an appropriate global
distutils config (see the guide referenced above) that put scripts in
someplace normal like /usr/local/bin/.

At any rate, it's not the place of rdiff-backup's seutp.py to look for
this issue. It should be handled at the global level by a sane Python
configuration.

Hope this helps,
Andrew

PS -- As Christopher noted, the Fink and DarwinPorts install python with
a sane configuration. The Fink system keeps everything in /sw, so it
added /sw/bin in my $PATH. It then installs python with a sys.prefix
value of /sw/. If I were creating a Linux distribution, I would
distribute python binaries with sys.prefix set to '/usr' so that scripts
would install in /usr/bin and the libraries in '/usr/lib'.


-- 
Andrew Ferguson - address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]