My name is Philipp C. Heckel and I write about nerdy things.

GCALDaemon deb-package for Ubuntu/Kubuntu


Linux, Office, Scripting, Synchronization

GCALDaemon deb-package for Ubuntu/Kubuntu


GCALDaemon (project doesn’t exist anymore, was at http://gcaldaemon.sourceforge.net/) is a great tool to synchronize many of Google’s services such as Google Calendar and Contacts with your local PC. Unfortunately, the installation on Ubuntu/Kubuntu and any other Linux distribution is still not the most comfortable. For this reason, I sat down some hours and packed the tool into a deb-package and additionally added a nice command line tool to simplify some of the basics.


Contents


Updates

There have been a couple of updates over the years. Here’s a summary:

  • Update Nov ’08: Ubuntu Intrepid: I just re-installed my Ubuntu and successfully tested the provided version for the new system. Works like a charm for Hardy and for Intrepid. About 150 downloads so far, no complains/malfunctions!
  • Update Feb ’09: Launchpad: I just uploaded the code that creates the deb-package on Launchpad. Maybe somebody of the Ubuntu team will pick it up and integrate it into the distribution. There is also a bug report for this issue, – feel free to contribute.
  • Update Apr ’09: Ubuntu 9.04, Jaunty Jackalope: As Jens just wrote in the comments-section, the deb-package seems to work for Jaunty as well without complications. Yeyy!
  • Update Jan ’11: Ubuntu 10.04 & 10.10: According to my tests, the package still works perfectly with both Lucid Lynx and Maverick Meerkat.

1. Get the package

1.1. Create your own deb package

For those who can’t wait, here’s the package: gcaldaemon_1.0beta16~ubuntu0_all.deb

For all of you interested how to create your own package from my sources, follow these steps:

1.2. Download and install

Alternatively to creating the package from my source, you can just download and install it from my deb-file:

2. Usage & Configuration

The following tools will be available:

  • gcaldaemon
    Start/stop/restart the daemon.
  • gcaldaemon-sync-now
    For immediate synchronization.
  • gcaldaemon-config
    Open the graphical config editor.
    Also available via the menu „Utilities -> Configure GCALDaemon”.
  • gcaldaemon-password-encoder
    Encode passwords for the config file.

Each user of the system can have his or her own instance of the daemon running.
The config file is located at ~/.gcaldaemon/conf/gcal-daemon.cfg.

To edit the config file, you can either use your favorite editor, e.g. vi or use the GCALDaemon config editor GUI:

You can also open the config editor via the menu: „Utilities -> Configure GCALDaemon”.

To create passwords for the config file use the gcaldaemon-password-encoder-script. For details about the config options, please read the GCALDaemon documentation (site defunct, July 2019).

3. Running GCALDaemon

I have simplified the way how to start/stop the daemon with a small script. Simply type “gcaldaemon” to see what it can do.

To start, restart, stop and check the status (just like in an init-script), type:

4. Enable autostart for GCALDaemon

To enable the autostart-option for GNOME or KDE, type:

As a GNOME user, it’s also possible to enable/disable the daemon autostart via the menu „System -> Settings -> Sessions”

5. Finally …

I know that the package is far from perfect, but it’s a lot easier to install/configure than the original package. Feedback is always welcome.

48 Comments




  1. TDM

    Very interested in this however as a Newbie to Ubuntu, some of the above seems a little over me I am afraid to say.

    Comments show it works well..assume with Evolution?

    Thanks for more detail.


  2. Philipp

    Hey TDM,

    should work as well with Evolution.
    Please refer to the GCALDaemon documentation for more details about the application.

    Merry Christmas!
    Philipp



  3. Arnold

    It seems like the enabling autostart does not work properly. I am using Ubuntu Intrepid. Installation as shown above including the command “gcaldaemon enable gnome”. But after restarting the computer gcaldaemon does not start up. Also I cannot find the System–>Settings–>Sessions option. I mean I have the menu but there is no option to check for gcaldaemon. Everything else is working fine! Thanks for that in any case!




  4. Philipp

    Hey Lure,

    I’m sorry I totally forgot about that. I wanted to do it in January ….

    Take a look at the code I uploaded on Launchpad. If you need anything or you want me to change it, please let me know.

    Regards,
    Philipp


  5. Dave

    There is a problem when running the config utility on a system with Compiz where the GUI comes up blank. It is a known problem with Java/Swing apps and can be solved by putting the following entry into your ~/.profile and then logging out and back in.

    export AWT_TOOLKIT=MToolkit

    Hope this helps somebody else.



  6. bve

    Try also this nice init-script, which I found somewhere on the net. It replaces the autostart-option you mention and starts gcaldaemon before KDE/gnome etc., systemwide:

    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides: gcald
    # Required-Start: $network $local_fs $remote_fs
    # Required-Stop: $network $local_fs $remote_fs
    # Default-Start: 2 3 4 5
    # Default-Stop: S 0 1 6
    # Short-Description: GCALDaemon
    ### END INIT INFO

    PATH=/usr/sbin:/usr/bin:/sbin:/bin
    DESC=”Google Calendar and address book sync daemon”
    NAME=gcald
    PIDFILE=”/var/run/$NAME.pid”
    SCRIPTNAME=”/etc/init.d/$NAME”

    BASEDIR=/usr/local/sbin/GCALDaemon
    makepath()
    {
    local IFS=:
    echo “$*”
    }
    CLASSPATH=$(makepath “$BASEDIR”/lib/*)
    CLASS=org.gcaldaemon.standalone.Main
    ARGS=$BASEDIR/conf/gcal-daemon.cfg
    DAEMON=/usr/bin/java
    DAEMON_ARGS=”-Xmx256m -cp $CLASSPATH $CLASS $ARGS”

    # Exit if the package is not installed
    [ -x “$DAEMON” ] || exit 0
    [ -d “$BASEDIR” ] || exit 0

    # Define LSB log_* functions.
    . /lib/lsb/init-functions

    #
    # Function that starts the daemon/service
    #
    do_start()
    {
    # Return
    # 0 if daemon has been started
    # 1 if daemon was already running
    # 2 if daemon could not be started
    start-stop-daemon –start –pidfile $PIDFILE –exec “$DAEMON” –test > /dev/null \
    || return 1
    start-stop-daemon –start –pidfile $PIDFILE –exec “$DAEMON” –background –make-pidfile — \
    $DAEMON_ARGS \
    || return 2
    }

    #
    # Function that stops the daemon/service
    #
    do_stop()
    {
    # Return
    # 0 if daemon has been stopped
    # 1 if daemon was already stopped
    # 2 if daemon could not be stopped
    # other if a failure occurred
    start-stop-daemon –stop –quiet –retry=TERM/30/KILL/5 –pidfile “$PIDFILE” –exec “$DAEMON”
    RETVAL=”$?”
    [ “$RETVAL” = 2 ] && return 2
    rm -f “$PIDFILE”
    return “$RETVAL”
    }

    case “$1” in
    start)
    log_daemon_msg “Starting $DESC”
    do_start
    case “$?” in
    0|1) log_end_msg 0 ;;
    2) log_end_msg 1 ;;
    esac
    ;;
    stop)
    log_daemon_msg “Stopping $DESC”
    do_stop
    case “$?” in
    0|1) log_end_msg 0 ;;
    2) log_end_msg 1 ;;
    esac
    ;;
    restart|force-reload)
    log_daemon_msg “Restarting $DESC”
    do_stop
    case “$?” in
    0|1)
    do_start
    case “$?” in
    0) log_end_msg 0 ;;
    1) log_end_msg 1 ;; # Old process is still running
    *) log_end_msg 1 ;; # Failed to start
    esac
    ;;
    *)
    # Failed to stop
    log_end_msg 1
    ;;
    esac
    ;;
    *)
    echo “Usage: $SCRIPTNAME {start|stop|restart|force-reload}” >&2
    exit 3
    ;;
    esac


  7. Philipp

    @bblboy54: Not yet. But it should work, it’s nothing Ubuntu/Kubuntu-special on this package. Please let me know if it worked for you.

    @bve: Thanks for the contribution. But my idea followed a different approach: As there might be different users on a workstation, it is useful that each user has its own set of config files and controls whether or not he/she wants to autostart GCALDaemon or not …



  8. Jens

    Finally, using your great deb package, sync beetween Google calendar and Evolution works perfectly in Ubuntu 9.04, Jaunty Jackalope.


  9. Dixit

    Thanks….great work…i will tag ur blog in my blog…


  10. Nettled

    Thanks for the script. This is still ridiculously complex. As a noob, I found it impossible to follow without step-by-step instructions.



  11. Kelloggs

    Wow! I just installed myself and thought about customizing it a bit more to Kubuntu. But you allready did the job.

    And it works like charm. You made my day, thanks a lot!


  12. Kelloggs

    I have just one little problem with the contact import from gmail: when i have a look at the csv.file i can see all the data i have in my gmail-account. But the generated vcards have only a few o these and therefore i have no e.g. addresses.

    Do you have any idea whats going wrong?


  13. Philipp

    Hey Kelloggs,

    AFAIK this is a general limitation of the Google Contacts API. As you know, it doesn’t support separate fields for the addresses, but has only one text-box “Address”…

    That’s all I can say …


  14. jay

    This is a great deb package, and seems to work well, except for one problem. Changes made to Google Calendar show up on Korganizer, but not the opposite direction. How do I get changes in KOrganizer to show up on G. Calendar?


  15. Philipp

    hey jay,

    unfortunately i don’t have KOrganizer installed so i can’t test it with this particular peace of software, BUT this shouldn’t matter in this case:

    If you enable the file-based synchronization in GCALDaemon _and_ disable the dial-up-connection mode, GCALDaemon will poll the ICS-file for changes in regular intervals and update the selected calendars when the file has changed:

    To change these settings, open the graphical config editor (type ‘gcaldaemon-config’ or select it from the menu) and browse to ‘File synchronizer’. Enable the first checkbox (“Enable file-based calendar sync..”) and disable the second one (“Enable dial-up ..”).

    Now add the calendars to sync to the list at the bottom. I’d recommend you add a test-calendar to Google first to play around with!

    Hope this helps.

    Cheers,
    Philipp


  16. ejp

    Thank you! It works! This daemon is wonderful.

    have you got a amazon wish list???


  17. Philipp

    Hehe, I’m glad you like it.

    Thanks for offering, but you should maybe donate something to the author of GCALDaemon. I’m just the guy who packed it in an Ubuntu-package …

    Cheers,
    Philipp



  18. magatz

    Just a question?
    where is logging gcaldaemon now?
    Seems like i can’t find any log

    thanks


  19. Philipp

    Hey magatz,

    seems that I forgot to make a log-directory in the package. Create a folder called ~/.gcaldaemon/log. Then restart the daemon:

    $ mkdir ~/.gcaldaemon/log
    $ gcaldaemon restart

    I’ll work this thing in the next package.

    Regards,
    Philipp


  20. magatz

    Thank you Philip.

    Are you experiencing problem with the LDAP service?
    I’ve enabled it, and i’ve seen that the contacts are dowloaded as csv from google, but the ldap service seems non to work at all.
    Sorry for the question, but i don’t much activity on the project by the actual mantainers….

    by


  21. Vitalins

    Quite a decent blog, at least filling of topics. Have more to these blogs.


  22. kp

    Thanks for packaging this for us, my only problem is that, if you plan to run this in a command-line environment only, it might not be appropriate.

    I’ve had to change /usr/bin/gcaldaemon to load the default conf found /usr/share/gcaldaemon/conf.

    Also for people having trouble using the ldap service, please have a look here:

    http://sourceforge.net/projects/gcaldaemon/forums/forum/643348/topic/3417160/index/page/1


  23. mc

    Just found this – really very nice, thanks.

    Having the config file in the home dir was good – I need to carry my home dir between machines, so the gcaldaemon default of having it in the program dir was not good.

    Also, your easy script for stopping the daemon (gcaldaemon stop) was helpful. I keep the calendars on an encrypted dis, and need to be able to stop the daemon before dismounting. Wan’t sure how to stop it otherwise as the process name is a bit unhelpful.

    Using it on Kubuntu 8.04. Will soon switch to 10.04.
    mc


  24. mc

    I posted my comments to the launchpad bug report
    https://bugs.launchpad.net/ubuntu/+bug/305446
    mc


  25. Philipp C. Heckel

    Hallo mc,

    thank you for your nice comments — esp. the ones of the bug reports.
    I think the problem is that GCALDaemon is not in active development and I don’t know have the Debian/Ubuntu guys feel about adding an outdated package to the repo.

    Let’s continue this discussion on the bug report page…

    Regards,
    Philipp


  26. mc

    Have been using this for 2 months very smoothly.
    But yesterday I went to look at the log file,
    found it at:
    /usr/share/gcaldaemon/log/gcal-daemon.log
    but it was empty.
    I wonder if as part of moving things around, something has gone wrong with specifying the log file?

    Just in case, I checked,
    there was no log file in the work directory, nor in the home dir.
    regards
    mc


  27. mc

    To Jay, June 16 2009:

    I now use it with KOrganizer and it works well, syncs both ways.

    I use it with file synchronizer, enable offline mode (“Enable dial-up connection…”).
    The calendar address you specify in the iCal Calendar column (in the graphical configuration) should be the KOrg calendar.


  28. mc

    Problem on 1st June 16 post solved, though cause not known.

    To fix changed file:
    ~/.gcaldaemon/conf/logger-config.cfg
    line
    log4j.appender.file.Directory=autodetect
    line to:
    log4j.appender.file.Directory=~/.gcaldaemon
    and now I get a log file.

    Though why the autodetect didn’t give me a log file I don’t know.
    May have something to do with permissions.



  29. Christian

    Hey,

    I just tried it on Ubuntu 10.10 Maverick and I could not get it running, if I run “gcaldaemon start” in the terminal and check it with “gcaldaemon status” I get “GCALDaemon is NOT runnig”.

    Anyone an idea where the problem is, does anyone got it running on Maverick?

    thanks for any help ;-)
    Christian


  30. Philipp C. Heckel

    Hi Christian,

    I just installed a fresh Ubuntu 10.10 in a virtual machine and it works like a charm. Try running the start-command manually and see if there is any errors:

    /usr/bin/java -Xmx256m -cp /usr/share/gcaldaemon/lib/activation.jar:/usr/share/gcaldaemon/lib/commons-codec.jar:/usr/share/gcaldaemon/lib/commons-collections.jar:/usr/share/gcaldaemon/lib/commons-httpclient.jar:/usr/share/gcaldaemon/lib/commons-io.jar:/usr/share/gcaldaemon/lib/commons-lang.jar:/usr/share/gcaldaemon/lib/commons-logging.jar:/usr/share/gcaldaemon/lib/gcal-daemon.jar:/usr/share/gcaldaemon/lib/gdata-calendar.jar:/usr/share/gcaldaemon/lib/gdata-client.jar:/usr/share/gcaldaemon/lib/ical4j.jar:/usr/share/gcaldaemon/lib/jdom.jar:/usr/share/gcaldaemon/lib/logger.jar:/usr/share/gcaldaemon/lib/mail.jar:/usr/share/gcaldaemon/lib/rome.jar:/usr/share/gcaldaemon/lib/servlet-api.jar:/usr/share/gcaldaemon/lib/shared-asn1.jar:/usr/share/gcaldaemon/lib/shared-ldap.jar org.gcaldaemon.standalone.Main ~/.gcaldaemon/conf/gcal-daemon.cfg

    I hope this helps a little.

    Regards,
    Philipp


  31. Christian

    Hey Philipp,

    here is the output:
    INFO | GCALDaemon V1.0 beta 16 starting…
    INFO | RSS/ATOM feed converter enabled.
    INFO | Local time zone is Mitteleuropäische Zeit.
    INFO | HTTP server starting on port 9090…
    FATAL | ADDRESS ALREADY IN USE
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    at org.gcaldaemon.core.Configurator.startService(Configurator.java:743)
    at org.gcaldaemon.core.Configurator.(Configurator.java:658)
    at org.gcaldaemon.standalone.Main.main(Main.java:66)
    Caused by: java.net.BindException: Address already in use
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:336)
    at java.net.ServerSocket.bind(ServerSocket.java:336)
    at java.net.ServerSocket.(ServerSocket.java:202)
    at java.net.ServerSocket.(ServerSocket.java:114)
    at org.gcaldaemon.core.http.HTTPListener.(HTTPListener.java:122)
    … 7 more
    FATAL | Service terminated!
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    at org.gcaldaemon.core.Configurator.startService(Configurator.java:743)
    at org.gcaldaemon.core.Configurator.(Configurator.java:658)
    at org.gcaldaemon.standalone.Main.main(Main.java:66)
    Caused by: java.net.BindException: Address already in use
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:336)
    at java.net.ServerSocket.bind(ServerSocket.java:336)
    at java.net.ServerSocket.(ServerSocket.java:202)
    at java.net.ServerSocket.(ServerSocket.java:114)
    at org.gcaldaemon.core.http.HTTPListener.(HTTPListener.java:122)
    … 7 more

    As far as I understood, another program is using this port. But I don’t know what to do…

    Thanks ;-)
    Christian


  32. Philipp C. Heckel

    Hey Christian,

    that can happen if you accidentally started it twice (which shouldn’t happen if you use the script); or if you have other applications running on that port (which is unlikely since 9090 is not a common port).

    I’d suggest killing the application that’s “stealing the port”. First find the thief with “netstat -ntap | grep 9090”, then kill the listed PIDs with “kill -9 “.

    Hope this helps.

    Regards,
    Philipp


  33. Christian

    Hello Philipp,

    thanks for the reply – it’s working now on my laptop ;-) !

    But it is not working on the desktop PC. I added GCALDaemon to the auto start and I can see it in the list, but if I check the status after the start up I always get “…is NOT running”! If I try your last post, I get the error “…2011-02-09 10:27:09 | FATAL | Configurator | MISSING PRIVATE ICAL URL (FILE.PRIVATE.ICAL.URL)!…”

    What should I do here?

    Thanks a lot for your help in advance!

    Regards
    Christian


  34. Philipp C. Heckel

    Hey Christian,

    I suppose that means that you did not configure GCALDaemon correctly.

    The property “file.private.ical.url” should be something like this: file.private.ical.url=/calendar/ical/…/private/basic.ics. You can get that URL from the Google Calendar interface.

    To change the value, either take a look in the file ~/.gcaldaemon/conf/gcal-daemon.cfg or use the graphical user interface via “Accessories” -> “Configure GCALDaemon” -> “File synchronizer” -> “New …”.

    Regards,
    Philipp


  35. Matthäus Brandl

    Hey Philipp,
    is GCalDaemon still working for you. I tried to set up the LDAP server yesterday via your package, but verification of my account doesn’t work because a captcha is required.
    Is there a possibility to turn it off, or is GCD broken?
    Regards, Matthäus


  36. Philip

    Hi there,

    I just got your deb running on mint 11 (ubuntu 11.04) – I initially took a look at the gcaldeamon instalation instructions and I added it to the too difficult pile – however when I did some searching I found your package and it works fine with the gcaldaemon-sync-now. I have not tried to run it in the background as I only need it to run as a cron job.

    Thanks for that

    Cheers

    Phil


  37. SL

    Hello

    I ran into several problems while trying to generate a deb for Debian.

    To sum it up:
    – my build folder was not bzr-ready, I needed to add “–use-existing-dir” to actually get the code from the repo
    – the DEBIAN folder needs to be 755 or 775 (it would be nice if this could be handled by the code fetch, but I guess it is actually linked to umask, so is system-dependent)
    – these permissions must be kept when the DEBIAN folder is copied to the temp dir
    – there was a problem in the control file format

    I also cleaned up the check on being root to create the package, because being root is not necessary.

    Here how I do it, in the folder where you want to build:

    [sourcecode language=”bash”]
    bzr branch –use-existing-dir lp:~binwiederhier/+junk/gcaldaemon
    chmod o+rx skeleton/DEBIAN
    patch -p1 < ./gcaldaemon.patch
    wget http://downloads.sourceforge.net/gcaldaemon/gcaldaemon-linux-1.0-beta16.zip
    ./create-package.sh gcaldaemon-linux-1.0-beta16.zip 'gcaldaemon_1.0beta16~debian0_all.deb'
    [/sourcecode]

    And the content of the gcaldaemon.patch file:
    [sourcecode language="text"]
    diff -u -r gcaldaemon.orig/create-package.sh gcaldaemon/create-package.sh
    — gcaldaemon.orig/create-package.sh 2012-03-04 10:31:32.000000000 +0100
    +++ gcaldaemon/create-package.sh 2012-03-04 10:34:05.000000000 +0100
    @@ -28,11 +28,6 @@
    exit 1
    fi

    -if [ $(id -u) != "0" ]; then
    – echo "ERROR: Need to be run as root."
    – exit 1
    -fi

    ZIPFILE=$1
    DEBFILE=$2

    @@ -43,7 +38,7 @@

    echo "Copying skeleton to $PACKAGEDIR …"
    -cp -R skeleton/* "$PACKAGEDIR/"
    +cp -pR skeleton/* "$PACKAGEDIR/"

    echo "Unzipping to $UNZIPDIR …"
    Seulement dans gcaldaemon: gcaldaemon_1.0beta16~debian0_all.deb
    Seulement dans gcaldaemon: gcaldaemon-linux-1.0-beta16.zip
    diff -u -r gcaldaemon.orig/skeleton/DEBIAN/control gcaldaemon/skeleton/DEBIAN/control
    — gcaldaemon.orig/skeleton/DEBIAN/control 2012-03-04 10:31:32.000000000 +0100
    +++ gcaldaemon/skeleton/DEBIAN/control 2012-03-04 10:17:35.000000000 +0100
    @@ -12,6 +12,6 @@
    and various iCalendar compatible calendar applications. It is primarily designed as
    a calendar synchronizer but it can also be used as a Gmail notifier, Address Book
    importer, Gmail terminal and RSS feed converter.

    + .
    The project is hosted on Sourceforge, http://gcaldaemon.sourceforge.net/
    Distributed under the Apache License Version 2.0
    [/sourcecode]

    HTH, thanks for the original work :)