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.

I imagine there's a environment variable or some setting I'm unaware of, but this is driving me nuts.

baco:~ # ls -la /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin       
-rwxr-x---  1 root root 57263 Mar 10  2008 /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin
baco:~ # ls -la /usr/local/subversion-1.6.1/subversion/svnadmin/.libs/svnadmin  
-rwxr-xr-x  1 root root 76125 Apr 20  2009 /usr/local/subversion-1.6.1/subversion/svnadmin/.libs/svnadmin

I have two versions of svnadmin compiled there. If I execute one I get it

baco:~ # /usr/local/subversion-1.6.1/subversion/svnadmin/.libs/svnadmin --version
svnadmin, version 1.6.1 (r37116)
   compiled Apr 20 2009, 16:09:36

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository back-end (FS) modules are available:

* fs_base : Module for working with a Berkeley DB repository.
* fs_fs : Module for working with a plain file (FSFS) repository.

If I execute the other, with full path, I still get the earlier!

baco:~ # /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin --version
svnadmin, version 1.6.1 (r37116)
   compiled Apr 20 2009, 16:09:36

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository back-end (FS) modules are available:

* fs_base : Module for working with a Berkeley DB repository.
* fs_fs : Module for working with a plain file (FSFS) repository.

If I run svnadmin without path information, I also get the 1.6.1 version (normal, due to $PATH). Via cron I can get the 1.4.6 executed, so this has to be something particular to interactive or login shells.

EDIT:

I know that cron is executing the 1.4.6 because I've run /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin --version via cron and I get output from a 1.4.6 version (with the proper compilation date). If I run the 1.6.1 version with full path via cron I do get 1.6.1's output.

Both are binary files:

baco:~ # file /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin
/root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped
baco:~ # file /usr/local/subversion-1.6.1/subversion/svnadmin/.libs/svnadmin
/usr/local/subversion-1.6.1/subversion/svnadmin/.libs/svnadmin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped

They are not hard links either

baco:~ # stat -c %h /usr/local/subversion-1.6.1/subversion/svnadmin/.libs/svnadmin
1
baco:~ # stat -c %h /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin   
1
share|improve this question
    
In your very first ls, why does the 1.4 version of subversion not have world read/execute permissions while 1.6 does? –  Caleb Jun 9 '11 at 9:07
    
because it's inside /root, and it's the default umask for that directory. I fail to see how can this be related, as the test has been performed as root. –  Vinko Vrsalovic Jun 9 '11 at 9:20
    
what happens if you chmod -x the one you don't want? –  Kim Jun 9 '11 at 9:54
1  
How do you know that bash is executing a different file? That would indeed be surprising. A likely explanation is that svnadmin is a script that calls some other executable, and it finds that other executable through $PATH or some other setting and not by looking at where it was called through. What does file …/svnadmin show? And for that matter, how do you know that cron is executing 1.4.6, and that it's getting it from that location? –  Gilles Jun 9 '11 at 9:56
3  
A shot in the dark: could it be that the svnadmin binary is just a tiny layer of code that loads a shared library to do the actual work (including the version number)? Then, difference in the LD_LIBRARY_PATH between your interactive session and cron would explain the difference. Indeed, if I run strings $which svnadmin), the version message does not appear in the output, so it's not part of the svnadmin binary. –  Riccardo Murri Jun 9 '11 at 11:35

1 Answer 1

up vote 3 down vote accepted

Looks like the svnadmin binary is just a layer of code that wraps a shared library to do the actual work (including the version number). Indeed, if I run strings $(which svnadmin), the version message does not appear in the output, so it's not part of the svnadmin binary.

So, a difference in the LD_LIBRARY_PATH between your interactive session and cron could explain the difference in behavior.

share|improve this answer

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.