Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-28173

Fix nuxeoctl crashing for some duplicate properties in nuxeo.conf

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 11.1, 2021.0
    • Component/s: Launcher
    • Tags:
    • Team:
      PLATFORM
    • Sprint:
      nxplatform 11.1.21
    • Story Points:
      1

      Description

      If there are more than one occurrence of nuxeo.log.dir or nuxeo.tmp.dir in nuxeo.conf, nuxeoctl crashes for instance with:

      $ ./bin/nuxeoctl mp-list
      mkdir: impossible de créer le répertoire «/tmp\n»: Permission non accordée
      cp: impossible de créer le fichier standard '/tmp'$'\n''/tmp/nuxeo-launcher-32689.jar': Aucun fichier ou dossier de ce type
      Error: Unable to access jarfile /tmp
      /tmp/nuxeo-launcher-32689.jar
      

      Since, in case of duplicates, we should only care about the last entry, a simple fix would probably be:

      diff --git a/nuxeo-distribution/nuxeo-server-tomcat/src/main/resources/tomcat/bin/nuxeoctl b/nuxeo-distribution/nuxeo-server-tomcat/src/main/resources/tomcat/bin/nuxeoctl
      index f4fabdd..1a9926f 100755
      --- a/nuxeo-distribution/nuxeo-server-tomcat/src/main/resources/tomcat/bin/nuxeoctl
      +++ b/nuxeo-distribution/nuxeo-server-tomcat/src/main/resources/tomcat/bin/nuxeoctl
      @@ -188,12 +188,12 @@ case $JAVA_VERSION in
       esac
       
       ## nuxeo.log.dir
      -LOG_DIR=$(grep "^nuxeo.log.dir=" "$NUXEO_CONF" | cut -d= -f2-)
      +LOG_DIR=$(grep "^nuxeo.log.dir=" "$NUXEO_CONF" | cut -d= -f2- | tail -n 1)
       # Defaults
       : ${LOG_DIR:="$NUXEO_HOME"/log}
       
       ## nuxeo.tmp.dir
      -TMP_DIR=$(grep "^nuxeo.tmp.dir=" "$NUXEO_CONF" | cut -d= -f2-)
      +TMP_DIR=$(grep "^nuxeo.tmp.dir=" "$NUXEO_CONF" | cut -d= -f2- | tail -n 1)
       # Defaults
       : ${TMP_DIR:="$NUXEO_HOME"/tmp}
       # TMPDIR is the canonical Unix environment variable specified in various Unix and similar standards
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h