LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Blogs > jere21
User Name
Password

Notices

Rate this Entry

funambol: Sync contacts and calendar

Posted 10-03-2011 at 11:13 AM by jere21
Updated 03-11-2012 at 10:57 AM by jere21 (added init script)

  1. Download funambol server package bundle (including java, webserver tomcat and database Hypersonic):
    32 bit: https://www.forge.funambol.org/servl...=FUNBUNDLE-LIN
    64 bit: https://www.forge.funambol.org/servl...UNBUNDLE-LIN64
  2. Install funambol:
    Code:
    chmod +x funambol-10.0.3-x64.bin
    sudo ./funambol-10.0.3-x64.bin
    • "yes" - accept license
    • "RETURN" - accept to install to /opt
    • "no" - Don't start the server yet

  3. Replace bundled java with system wide java installation:
    1. Install java:
      Code:
      ii  openjdk-6-jdk  6b24-1.11.1-3   OpenJDK Development Kit (JDK)
    2. Fix java:
      If you are hit by http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560044 with these
      symptoms:

      • http://localhost:8080/webdemo
        Login "guest" (password "guest")
        --> fails
      • Code:
        sudo /admin/bin/funamboladmin/funamboladmin
        File - Login
        --> "Host not found or reachable, please verify the connection parameters"
      • Code:
        $ sudo /opt/Funambol/bin/funambol stop
        Oct 4, 2011 6:33:15 PM org.apache.catalina.startup.Catalina stopServer
        SEVERE: Catalina.stop: 
        java.net.SocketException: Network is unreachable
        	at java.net.PlainSocketImpl.socketConnect(Native Method)
        	at java.net.PlainSocketImpl.doConnect(Unknown Source)
        	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        	at java.net.PlainSocketImpl.connect(Unknown Source)
        	at java.net.SocksSocketImpl.connect(Unknown Source)
        	at java.net.Socket.connect(Unknown Source)
        	at java.net.Socket.connect(Unknown Source)
        	at java.net.Socket.<init>(Unknown Source)
        	at java.net.Socket.<init>(Unknown Source)
        	at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:421)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        	at java.lang.reflect.Method.invoke(Unknown Source)
        	at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:337)
        	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
        java.sql.SQLException: socket creation error

      Solution:
      Code:
      sudo sed -i 's/net.ipv6.bindv6only\ =\ 1/net.ipv6.bindv6only\ =\ 0/' \
      /etc/sysctl.d/bindv6only.conf && sudo invoke-rc.d procps restart
      Don't know if this line in /opt/Funambol/bin/funambol-server|ctp-server|inbox-listener|pim-listener is related:
      Code:
      JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"
    3. Use java:
      Add in line 3 of /opt/Funambol/bin/funambol
      Code:
      export JAVA_HOME=/usr/lib/jvm/default-java
      # export JRE_HOME=$JAVA_HOME (don't know if this is necessary)
    4. Remove bundled java:
      Code:
      rm -rf /opt/Funambol/tools/jre-1.6.0

  4. Replace bundled tomcat with system wide tomcat installation:
    1. Install tomcat:
      Note: As of 2012-01-08 I think Funambol does not support tomcat70!
      Code:
      ii  tomcat6        6.0.35-1       Servlet and JSP engine
    2. Reconfigure tomcat (optional):
      I have a dual core processor, so I did a
      Code:
      sudo dpkg-reconfigure tomcat6
      and followed the help instructions for the tomcat 6 JVM Java options:
      Code:
      -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode
    3. Use tomcat:
      Edit /opt/Funambol/bin/funambol around line 39:
      Code:
       
      export J2EE_HOME=/usr/share/tomcat6
      export CATALINA_HOME=/usr/share/tomcat6
      export CATALINA_OUT=/var/log/tomcat6/catalina.out
      Edit /opt/Funambol/bin/funambol around line 48 (on "false" mysql server isn't started/stopped with funambol):
      Code:
      COMED=false
      Edit /opt/Funambol/bin/funambol-server around line 28:
      Code:
      #unset CATALINA_HOME
      Edit /opt/Funambol/bin/funambol-server around line 50:
      Code:
      J2EE_HOME=/usr/share/tomcat6
    4. Remove bundled tomcat:
      Code:
      rm -rf /opt/Funambol/tools/tomcat

  5. Replace bundled hypersonic with system wide mysql installation:
    1. Install mysql:
      Code:
      ii  mysql-server   5.1.58-1       MySQL database server (metapackage depending on the latest version
      ii  libmysql-java  5.1.16-2       Java database (JDBC) driver for MySQL
      Set mysql root password during package installation with debconf.
    2. Manually create link:
      Code:
      sudo ln -s  /usr/share/java/mysql-connector-java.jar /usr/share/tomcat6/lib/mysql-connector-java.jar
    3. Code:
      Create funambol database:
      Code:
      $ mysql -u root -p
      mysql> create database funambol;
      mysql> use funambol
      mysql> GRANT ALL PRIVILEGES ON funambol.* TO 'funambol'@'localhost' IDENTIFIED BY 'funambol';
      mysql> flush privileges;
      mysql> quit
    4. Replace hypersonic config with mysql
      Edit /opt/Funambol/ds-server/install.properties around line 24:
      Code:
      dbms=mysql
      Edit /opt/Funambol/ds-server/install.properties around line 63:
      Code:
      jdbc.classpath=/usr/share/java/mysql-connector-java.jar
      jdbc.driver=com.mysql.jdbc.Driver
      jdbc.url=jdbc:mysql://localhost/funambol?characterEncoding=UTF-8
      jdbc.user=funambol
      jdbc.password=funambol
    5. Remove bundled hypersonic:
      Code:
      rm -rf /opt/Funambol/tools/hypersonic /opt/Funambol/bin/hypersonic*



  6. Start it from the installation or manually with
    Code:
    sudo /opt/Funambol/bin/funambol start
  7. Verify it's running:
    Processes:
    Code:
    ps aux | grep -i Funambol
    root      5716  0.1  2.1 652444 45084 pts/0    Sl   Jan07   0:23 /usr/lib/jvm/default-java/bin/java -Dfile.encoding=UTF-8 -Dfunambol.home=/opt/Funambol -Djava.net.preferIPv4Stack=true -Xmx256M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=7101 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname= com.funambol.ctp.server.CTPServer
    root      5730  0.1  2.8 645512 58980 pts/0    Sl   Jan07   0:28 /usr/lib/jvm/default-java/bin/java -Dfile.encoding=UTF-8 -Dfunambol.home=/opt/Funambol -Dfunambol.pushlistener.config.bean=com/funambol/email/inboxlistener/InboxListenerConfiguration.xml -Djava.library.path=/opt/Funambol/inbox-listener/lib/x86_64 -Djavax.net.ssl.trustStore=/opt/Funambol/inbox-listener/lib/security/cacerts -Djava.net.preferIPv4Stack=true -Xmx256M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=4101 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname= com.funambol.email.inboxlistener.service.InboxListener
    root      5735  0.1  2.8 655540 58376 pts/0    Sl   Jan07   0:27 /usr/lib/jvm/default-java/bin/java -Dfile.encoding=UTF-8 -Dfunambol.home=/opt/Funambol -Dfunambol.pushlistener.config.bean=com/funambol/pimlistener/PIMListenerConfiguration.xml -Djava.net.preferIPv4Stack=true -Xmx256M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3101 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname= com.funambol.pimlistener.service.PimListener
    --> yes

    Webinterface: http://localhost:8080/funambol
    --> yes
  8. Set up the "Real World Test Drive" (see http://funambol.com/docs/v71/funambo...guide-v7.1.pdf)
    Code:
    sudo /opt/Funambol/admin/bin/funamboladmin
  9. Set up my phone Samsung Galaxy S
    "Einstellungen" -> "Drahtlos und Netzwerk" -> "Synchronisieren" -> "Neues Sync-Profil"
    Profilname: Funambol
    Sync.-Kategorie:
    • Kontakte:
      Externe Kontakte: card
      Benutzerkennung: [EMPTY!]
      Passwort:[EMPTY!]
    • Kalender:
      Externer Kalender: cal
      Note: I "deleted" my googlemail calendar on googlemail.com and now always use "Eigener Kalender"
    Sync.-Typ: Volst. Sync.
    Sync.Server: https://192.168.178.21:8080/funambol/ds
    Choose any username and password, the account will be created automatically with the first sync ("user self-provisioning").
  10. Sync: Whenever I'm in my WLAN I can sync: "Einstellungen" -> "Drahtlos und Netzwerk" -> "Synchronisieren" -> "Funambol" -> "Sync. starten"
  11. Init script
    /etc/init.d/funambol:
    Code:
    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:          funambol
    # Required-Start:    $remote_fs $syslog
    # Required-Stop:     $remote_fs $syslog
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: funambol init script
    # Description:       funambol init script
    ### END INIT INFO
    
    # Based upon Debian's /etc/init.d/skeleton
    
    # PATH should only include /usr/* if it runs after the mountnfs.sh script
    PATH=/sbin:/usr/sbin:/bin:/usr/bin
    DESC="Funambol"
    NAME=funambol
    DAEMON=/opt/Funambol/bin/$NAME
    SCRIPTNAME=/etc/init.d/$NAME
    
    # Exit if the package is not installed
    [ -x "$DAEMON" ] || exit 0
    
    # Load the VERBOSE setting and other rcS variables
    . /lib/init/vars.sh
    
    # Define LSB log_* functions.
    # Depend on lsb-base (>= 3.2-14) to ensure that this file is present
    # and status_of_proc is working.
    . /lib/lsb/init-functions
    
    #
    # Function that starts the daemon/service
    #
    do_start()
    {
    	$DAEMON start \
    		|| return 2
    }
    
    #
    # Function that stops the daemon/service
    #
    do_stop()
    {
    	$DAEMON stop
    	RETVAL="$?"
    	return "$RETVAL"
    }
    
    case "$1" in
      start)
    	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
    	do_start
    	case "$?" in
    		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
    		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    	esac
    	;;
      stop)
    	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
    	do_stop
    	case "$?" in
    		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
    		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    	esac
    	;;
      status)
           status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
           ;;
      restart|force-reload)
    	#
    	# If the "reload" option is implemented then remove the
    	# 'force-reload' alias
    	#
    	log_daemon_msg "Restarting $DESC" "$NAME"
    	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|reload|force-reload}" >&2
    	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
    	exit 3
    	;;
    esac
    Activate init script:
    Code:
    sudo chmod +x /etc/init.d/funambol
    sudo update-rc.d funambol defaults
  12. Alternatively to the init script, shut it down manually
    Code:
    sudo /opt/Funambol/bin/funambol stop




In the long run, download the bundle, check http://rachaelbond.com/funambol/ and update http://wiki.debian.org/FunambolInstallation
For now, I've omitted the described configuration:
Java browser plugin
JAVA_HOME

The mysql root user password is set during package installation with debconf (the given command in the wiki is wrong anyway)



Code:
ii  tinyca         0.7.5-3        simple graphical program for certification authority management
Posted in Uncategorized
Views 4550 Comments 3
« Prev     Main     Next »
Total Comments 3

Comments

  1. Old Comment
    I'm getting to STEP 7. I verify that Funambol is running. But when I go to the web browser and enter IP:8080 I get Tomcat. But IP:8080/webdemo results in a 404 error.

    Anyway you can help me with this please?
    Posted 10-13-2013 at 11:50 PM by jim.thornton jim.thornton is offline
  2. Old Comment
    I totally gave up on funambol. But anyway, looks as if you were trying to access it remotely. I'd try it locally first. Good luck!
    Posted 10-14-2013 at 11:03 AM by jere21 jere21 is offline
  3. Old Comment
    So did you not get any sync'ing going?? If so, how did you do it?
    Posted 10-14-2013 at 11:08 AM by jim.thornton jim.thornton is offline
 

  



All times are GMT -5. The time now is 04:17 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration