Karaf
  1. Karaf
  2. KARAF-1215

Shell scripts are incompatible with /bin/sh on Solaris

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.5, 3.0.0
    • Fix Version/s: 2.2.6, 3.0.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      SunOS

      Description

      The most restricted sh implmentation must be taken into account for all scripts.
      At the moment, "#!/bin/sh" is specified in shell file headers, but more advanced bash syntax/features are used in the code.
      For example in stop script:

      export KARAF_SCRIPT="stop"
      if [ -e "$DIRNAME/setenv" ]; then
        . "$DIRNAME/setenv"
      fi
      

      should be changed to:

      KARAF_SCRIPT="stop"; export KARAF_SCRIPT
      if [ -f "$DIRNAME/setenv" ]; then
        . "$DIRNAME/setenv"
      fi
      

      that would work both, on bin/sh and /bin/bash
      The same for admin, client, karaf, start scripts

        Activity

        Hide
        Jean-Baptiste Onofré added a comment -

        It looks good to me and works on my Solaris 10 (Sparc/V240).

        Show
        Jean-Baptiste Onofré added a comment - It looks good to me and works on my Solaris 10 (Sparc/V240).
        Hide
        Jean-Baptiste Onofré added a comment -

        Thanks Jamie, I gonna review it.

        Show
        Jean-Baptiste Onofré added a comment - Thanks Jamie, I gonna review it.
        Hide
        Jamie goodyear added a comment -

        Updated admin and client scripts.

        $ svn ci
        Sending assemblies/apache-karaf/src/main/filtered-resources/bin/admin
        Sending assemblies/apache-karaf/src/main/filtered-resources/bin/client
        Transmitting file data ..
        Committed revision 1308640.

        Show
        Jamie goodyear added a comment - Updated admin and client scripts. $ svn ci Sending assemblies/apache-karaf/src/main/filtered-resources/bin/admin Sending assemblies/apache-karaf/src/main/filtered-resources/bin/client Transmitting file data .. Committed revision 1308640.
        Hide
        Jean-Baptiste Onofré added a comment -

        Thanks for the update Zsolt.

        I'm fixing it.

        Show
        Jean-Baptiste Onofré added a comment - Thanks for the update Zsolt. I'm fixing it.
        Hide
        Zsolt Beothy-Elo added a comment -

        Not all of the scripts were fixed. The 'admin' and 'client' script still cause problems on Solaris.

        Show
        Zsolt Beothy-Elo added a comment - Not all of the scripts were fixed. The 'admin' and 'client' script still cause problems on Solaris.
        Hide
        Jean-Baptiste Onofré added a comment -

        Hi Ioannis, I have a Solaris 10 (Sparc and x86) here, let me know if you would like to fix that and test.

        Show
        Jean-Baptiste Onofré added a comment - Hi Ioannis, I have a Solaris 10 (Sparc and x86) here, let me know if you would like to fix that and test.
        Hide
        Igor Lazebny added a comment -

        archive of files diff attached

        Show
        Igor Lazebny added a comment - archive of files diff attached

          People

          • Assignee:
            Jean-Baptiste Onofré
            Reporter:
            Igor Lazebny
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development