Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3766

zkServer and other scripts should export CLASSPATH rather than use -cp

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 3.5.7
    • None
    • scripts

    Description

      ZooKeeper's launch scripts use `-cp` to pass the class path to Java when launching. This creates insanely large command-lines which are completely unnecessary.

      Java respects the CLASSPATH environment variable, and this is how the class path should be passed to Java when the process launches.

      So, instead of doing java -cp $CLASSPATH ..., the scripts should be doing export CLASSPATH; java ....

      The long command-lines make it difficult to troubleshoot, or view running process lists in tools like top, htop, ps, but also make it impossible to search and manage using tools like pgrep and pkill, which can only search for the first 4096 characters in the command-line. (See https://github.com/apache/fluo-uno/issues/243#issuecomment-601553260 for a specific issue involving this limit caused by ZK's scripts.)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ctubbsii Christopher Tubbs
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

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