apple / ccs-calendarserver

The Calendar and Contacts Server.
https://www.calendarserver.org
Apache License 2.0
486 stars 136 forks source link

memcached cannot find libevent.so #262

Closed macosforgebot closed 15 years ago

macosforgebot commented 15 years ago

macosforge@… originally submitted this as ticket:329


On ubuntu linux, I get the following error:

2009-03-24 00:00:16+0100 [-] [memcached] ../memcached-1.2.6/_root/bin/memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

ldd does show the correct link:

arnouten@bird:~/dev/calendaring/CalendarServer$ ldd ../memcached-1.2.6/_root/bin/memcached
        linux-gate.so.1 =>  (0xb7f28000)
        libevent-1.4.so.2 => /home/arnouten/dev/calendaring/libevent-1.4.8-stable/_root/lib/libevent-1.4.so.2 (0xb7ef4000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d7b000)
        libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7d61000)
        libnsl.so.1 => /lib/tls/i686/cmov/libnsl.so.1 (0xb7d48000)
        librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7d3f000)
        libresolv.so.2 => /lib/tls/i686/cmov/libresolv.so.2 (0xb7d2b000)
        /lib/ld-linux.so.2 (0xb7f0e000)

/home/arnouten/dev/calendaring/libevent-1.4.8-stable/_root/lib/libevent-1.4.so.2 indeed exists (though it is a symlink). Starting memcached from the commandline appears to work.

For now worked around this by setting both ClientEnabled and ServerEnabled to 'false' in conf/caldavd-dev.plist

macosforgebot commented 15 years ago

macosforge@… originally submitted this as comment:1:⁠ticket:329


Okay, disabling memcached breaks things ;). (it somehow caused the server to keep throwing "Authentication failed: Invalid nonce value" errors at me)

As a last resort I copied libevent-1.4.so.2 to /usr/lib and ran ldconfig as root. This makes the issue go away, but is undesirable for obvious reasons.

macosforgebot commented 15 years ago

@wsanchez originally submitted this as comment:2:⁠ticket:329


Did you try installing memcached separately (eg via package management)? That should work, since we'll use the installed one instead of trying to build it.

macosforgebot commented 15 years ago

will@… originally submitted this as comment:3:⁠ticket:329


I can confirm that this works on Ubuntu 7.10 (Gutsy).

apt-get install memcached libmemcache-dev

seems to do it. Libevent was brought in as a dependency.

macosforgebot commented 15 years ago

@wsanchez originally submitted this as comment:4:⁠ticket:329


OK thanks for that. I'm going to lower priority here, since that's probably preferable anyway.

The original build issue is probably a matter of setting an LD_LIBRARY_PATH environment variable or something, if someone wants to look into that.

macosforgebot commented 15 years ago

macosforge@… originally submitted this as attachment:librarypath.patch:⁠ticket:329


Patch to put the compiled libs in LD_LIBRARY_PATH and properly pass it to memcached's environment

macosforgebot commented 15 years ago

macosforge@… originally submitted this as comment:5:⁠ticket:329


I tried installing the memcached package before, but for some reason run seemed to insist on using its own version. Attached a patch that makes that actually work.

macosforgebot commented 15 years ago

@wsanchez originally submitted this as comment:6:⁠ticket:329


I'm wondering if we should stop trying to limit the server's environment and just let it inherit the environment. Lemme think a bit about why we started doing that in the first place.

macosforgebot commented 15 years ago

macosforge@… originally submitted this as comment:7:⁠ticket:329


Perhaps apply the conservative patch for now and leave the issue open to consider inheriting the entire environment later?

macosforgebot commented 15 years ago

@wsanchez originally submitted this as comment:8:⁠ticket:329


r4101 and r4102