Getting started under Linux
Hi, I'm trying to get starting running a carddav server under Linux, but got stuck. I installed all prerequisites just fine (after a little fight with the run command, which -oh horrors- decided to completely bypass my package manager and -even more horrors- install things outside the calenderserver folder. What happend to the good old ./configure or setup.py scripts?) The ./run -I command does not seem to work: ./run -I /opt/calendarserver did * create a folder /opt/calendarserver/bin with a copy of all tools from /usr/bin and /usr/local/bin (huh?) * abort with an error rsync: change_dir "/usr/caldavd" failed: No such file or directory (2) (huh again?) So I decided to just go for it, create a file conf/carddavd-dev.plist and try: ./run -a This seems to exec the following: ./bin/carddavd -X -L -f ./conf/carddavd-dev.plist -P caldav -t Combined Which in turns seems to exec: python /usr/local/bin/twistd -n carddav -f ./conf/carddavd-dev.plist \ -o ProcessType=Combined -o ErrorLogEnabled=False This fails with a "ImportError: No module named opendirectory", which is evident: opendirectory is not available under Linux, and was disabled in conf file in the first place. It seems that the conf/cardavd-dev.plist file is never read anyway, since simply running /usr/local/bin/twistd Gives the exact same result. I'm totally new to twisted, so I turned on logging, which according to the twistd man page is: /usr/local/bin/twistd -l - This time, no ImportError, but rather: Failed to load application: [Errno 2] No such file or directory: 'twistd.tap' I presume that twisted searches for a *.tap, *.tax or *.tas file in the current directory, and executes that application description. However, I can not find any such file in the calendarserver directory (there is this calendarserver/tap folder though). However, I'm at loss why it behaves differently with logging on or off. Just to emphasize my noob status, let me ask the obvious question: how do I start the server and have it read the config file? Any help is highly appreciated. Thank, Freek
On 2010/09/18 8:41 AM, Freek Dijkstra wrote:
I'm trying to get starting running a carddav server under Linux, but got stuck. I recently got CalDAV working under Linux (I have to look into getting CardDAV setup soon) but since they're similar hopefully my workarounds will work for you too! I'm guessing that most of what I've posted below should work just by substituting caldavd for carddavd when necessary.
The ./run -I command does not seem to work:
./run -I /opt/calendarserver
did * create a folder /opt/calendarserver/bin with a copy of all tools from /usr/bin and /usr/local/bin (huh?) * abort with an error rsync: change_dir "/usr/caldavd" failed: No such file or directory (2) (huh again?) Installation worked (mostly) for me but I used a system install (-i): $ ./run -i /opt/CalendarServer
First thing you'll want to do is setup some default configs: $ rm -rf /opt/CalendarServer/usr/caldavd/caldavd.plist $ cp conf/servertoserver-test.xml /opt/CalendarServer/etc/caldavd/servertoserver.xml $ cp conf/accounts.xml /opt/CalendarServer/etc/caldavd/accounts.xml $ cp conf/caldavd-test.plist /opt/CalendarServer/etc/caldavd/caldavd.plist $ cp conf/sudoers.plist /opt/CalendarServer/etc/caldavd/sudoers.plist $ chmod 600 /opt/CalendarServer/etc/caldavd/*
I presume that twisted searches for a *.tap, *.tax or *.tas file in the current directory, and executes that application description. However, I can not find any such file in the calendarserver directory (there is this calendarserver/tap folder though). However, I'm at loss why it behaves differently with logging on or off.
There are two bugs on Linux [1] [2] that result in in the Twisted extensions being installed to the wrong place on 64-bit systems, resulting in an error similar to what you're describing - are you on x86_64 by any chance? To fix the x86_64 bug, run: mv ../lib/python2.6/site-packages/twisted/plugins/caldav.py* ../lib64/python2.6/site-packages/twisted/plugins As for the PYTHONPATH bug, you'll need to modify the PYTHONPATH variable set in /opt/CalendarServer/usr/bin/caldavd and include the "site-packages" folders inside your CalendarServer installation directory as well as the system packages. For reference, mine looks like this: PATH="/usr/bin:$PATH" DESTDIR=/opt/CalendarServer PYTHONPATH="/usr/lib/python2.6/site-packages/:$PYTHONPATH:$DESTDIR/usr/lib/python2.6/site-packages/:$DESTDIR/usr/lib64/python2.6/site-packages/" I've added $DESTDIR to make it easy to change later should I decide to move my CalendarServer installation out of /opt. If you're using x86, then forget the last part with the lib64 (":$DESTDIR/usr/lib64/python2.6/site-packages/") [1] https://trac.calendarserver.org/ticket/391 [2] https://trac.calendarserver.org/ticket/390
Just to emphasize my noob status, let me ask the obvious question: how do I start the server and have it read the config file? Any help is highly appreciated.
I have a little script "run.sh" that I use when testing: #!/bin/sh /opt/CalendarServer/usr/bin/caldavd -X -f /opt/CalendarServer/etc/caldavd/caldavd.plist -T /opt/CalendarServer/usr/bin/twistd That starts CalendarServer forcing the use of the CalendarServer-patched Twisted with config file /opt/CalendarServer/etc/caldavd. Regards, Stewart
participants (2)
-
Freek Dijkstra
-
Stewart Adam