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

The env variables can't be read while running karaf as a Linux service

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.3
    • Fix Version/s: 3.0.2, 2.4.1, 2.3.9, 4.0.0.M3
    • Component/s: None
    • Labels:
      None

      Description

      Install karaf as a Linux service following steps:
      1. features:install wrapper
      2. wrapper:install -s AUTO_START -n talend-runtime -d talend-runtime -D "Talend Runtime Service"

      $ ln -s /Talend/runtime/bin/talend-runtime-service /etc/init.d/talend-runtime

      the fragment from generated script:

      # Still want to change users, recurse.  This means that the user will only be
      #  prompted for a password once.
        su -m $RUN_AS_USER -s /bin/sh -c "$REALPATH $1"
      

      it should be:

       # Still want to change users, recurse.  This means that the user will only be
       #  prompted for a password once.
       su - -m $RUN_AS_USER -c "$REALPATH $1"
      

      Because the user login script (.bash_profile) can't be executed without '-' after 'su'; and '-s /bin/sh' is not standard, the default shell of the run_as user (e.g. bash) should be used.

        Attachments

          Activity

            People

            • Assignee:
              jbonofre Jean-Baptiste Onofré
              Reporter:
              xldai Xilai Dai
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: