Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2734

Karaf service wrapper not working on Raspberry Pi

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.3.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      Rasbian Wheezy 3.10

      Description

      Hello,

      I tried to install the Karaf service wrapper on a Raspberry Pi as described on this site http://karaf.apache.org/manual/latest-2.3.x/users-guide/wrapper.html. There it is said that it should work with any distribution.

      Unfortunately if I try to execute the created script with /etc/init.d/KARAF-service start I get following error:

      $ sudo update-rc.d KARAF-service defaults
      update-rc.d: using dependency based boot sequencing
      insserv: warning: script 'K01karaf-service' missing LSB tags and overrides
      insserv: warning: script 'KARAF-service' missing LSB tags and overrides
      insserv: warning: script 'karaf-service' missing LSB tags and overrides

      $ /etc/init.d/KARAF-service start
      Starting Karaf...
      /home/pi/apache-karaf-2.3.3/bin/KARAF-wrapper: 1: /home/pi/apache-karaf-2.3.3/bin/KARAF-wrapper: Syntax error: "(" unexpected

      If I then change the first line of KARAF-service from #! / bin / sh to #! / bin / bash I don't get that error anymore but another one:

      $ /etc/init.d/KARAF-service start Starting Karaf...
      /etc/init.d/KARAF-service: line 417: /home/pi/apache-karaf-2.3.3/bin/KARAF-wrapper: cannot execute binary file
      /etc/init.d/KARAF-service: line 417: /home/pi/apache-karaf-2.3.3/bin/KARAF-wrapper: Success

      $ /etc/init.d/KARAF-service status
      Karaf is not running.

      My assumption is that the service wrapper is not working, because the Raspberry Pi is build on an ARM architecture, rather than an intel one, which seems to be not supported.

      Could you please help me fix this issue as it's important for me to be able to run Karaf as a service.

      Best regards.

        Activity

        Hide
        iodb Ivan Op de Beeck added a comment -

        I ran into the same problem a while ago.

        The Karaf wrapper feature uses Tanuki Software's Java Service Wrapper library. This library's native code is compiled for ARMv7, not the Raspberry Pi's ARMv6.

        Options include:

        Show
        iodb Ivan Op de Beeck added a comment - I ran into the same problem a while ago. The Karaf wrapper feature uses Tanuki Software's Java Service Wrapper library. This library's native code is compiled for ARMv7, not the Raspberry Pi's ARMv6. Options include: recompile JSW for the correct processor architecture ( http://sourceforge.net/mailarchive/message.php?msg_id=30767505 ) file a bug report with Tanuki software and wait switch to another service wrapper, like YAJSW ( http://yajsw.sourceforge.net ), which is all-Java, and therefore should run on any architecture
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        We have to stay with the Tanuki JSW 3.2.3 because it's the latest one compliant with the Apache license.

        For Windows 8 platform, I recompiled JSW for the target platform. I will check to cross-compile for ARMv6.

        Regarding switching to another service wrapper library, I started some update/evaluation of Apache commons-daemon. As yajsw is under LGPL license, unfortunately, it's not fully compliant with the Apache license and so can't be included in Karaf.

        Show
        jbonofre Jean-Baptiste Onofré added a comment - We have to stay with the Tanuki JSW 3.2.3 because it's the latest one compliant with the Apache license. For Windows 8 platform, I recompiled JSW for the target platform. I will check to cross-compile for ARMv6. Regarding switching to another service wrapper library, I started some update/evaluation of Apache commons-daemon. As yajsw is under LGPL license, unfortunately, it's not fully compliant with the Apache license and so can't be included in Karaf.
        Hide
        daveismith David Smith added a comment -

        You can get Tanuki JSW 3.2.3 to work on a beaglebone black (also arm based) without too much hackery. Some instructions:

        1. download latest version of ant and put in a location of your preference (for me /opt/apache-ant-<version>).
        2. download Tanuki JSW 3.2.3 and uncompres to somewhere like (~/wrapper_3.2.3_src)
        3. cd ~/wrapper_3.2.3_src
        4. edit build32.sh and update WRAPPER_TOOLS to point to your ant install (/opt/apache-ant-<version>)
        5. cp src/c/Makefile-linux-x86-32 src/c/Makefile-linux-arm-32
        6. edit src/c/Makefile-linux-arm-32
          • < COMPILE = gcc -O3 -Wall --pedantic
            ---
            > COMPILE = gcc -O3 -Wall --pedantic -lm -fPIC
            
          • < 	${COMPILE} -shared -fPIC $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
            ---
            > 	${COMPILE} -fPIC -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
            
        7. run build32.sh

        you may not need the second modification to the make file.

        Show
        daveismith David Smith added a comment - You can get Tanuki JSW 3.2.3 to work on a beaglebone black (also arm based) without too much hackery. Some instructions: download latest version of ant and put in a location of your preference (for me /opt/apache-ant-<version>). download Tanuki JSW 3.2.3 and uncompres to somewhere like (~/wrapper_3.2.3_src) cd ~/wrapper_3.2.3_src edit build32.sh and update WRAPPER_TOOLS to point to your ant install (/opt/apache-ant-<version>) cp src/c/Makefile-linux-x86-32 src/c/Makefile-linux-arm-32 edit src/c/Makefile-linux-arm-32 < COMPILE = gcc -O3 -Wall --pedantic --- > COMPILE = gcc -O3 -Wall --pedantic -lm -fPIC < ${COMPILE} -shared -fPIC $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so --- > ${COMPILE} -fPIC -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so run build32.sh you may not need the second modification to the make file.
        Hide
        splatch Łukasz Dywicki added a comment - - edited

        I checked yajsw and starting from version 12 is licensed under ASL v2 except two components which are not mandatory to run service: service manager and mail script: http://yajsw.sourceforge.net/#mozTocId236130

        Show
        splatch Łukasz Dywicki added a comment - - edited I checked yajsw and starting from version 12 is licensed under ASL v2 except two components which are not mandatory to run service: service manager and mail script: http://yajsw.sourceforge.net/#mozTocId236130

          People

          • Assignee:
            jbonofre Jean-Baptiste Onofré
            Reporter:
            st.huber Stephan Huber
          • Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:

              Time Tracking

              Estimated:
              Original Estimate - 48h
              48h
              Remaining:
              Remaining Estimate - 48h
              48h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development