Uploaded image for project: 'controller'
  1. controller
  2. CONTROLLER-1526

"karaf" script invokes /bin/sh but requires /bin/bash functions

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • Beryllium
    • None
    • karaf
    • None
    • Operating System: All
      Platform: All

    • 6030

    Description

      The bin/mvn script uses the "local" command which is a shell builtin of bash and similar shells, but is not required for POSIX-compliance in sh. When I attempt to run karaf on a Solaris system, I see the following output:

      root@solaris:/opendaylight/bin# ./karaf
      ./karaf[172]: local: not found [No such file or directory]
      ./karaf[182]: local: not found [No such file or directory]
      ./karaf[183]: local: not found [No such file or directory]

      Lines 172, 182 and 183 invoke "local" to make local variables to the function. According to "man bash", this is a shell builtin. However, bin/karaf is invoked as:

      #!/bin/sh

      On most flavors of linux, this resolves to bash or dash which probably runs in a restricted environment after checking to see that its $0 is sh. But on Solaris's /bin/sh is actually ksh93 for backwards compatibility.

      Since "local" is not part of a POSIX-compliant /bin/sh, depending on it in a script that is invoked with /bin/sh is a bug.

      (this explain is borrowed from https://issues.apache.org/jira/browse/MNG-5852)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            adetalhouet Alexis de Talhouƫt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: