candlerb commented on issue #5650: pulsar-admin: avoid changing working directory URL: https://github.com/apache/pulsar/issues/5650#issuecomment-553780096 > Usually the executing path is PULSAR_HOME, so the relative paths is based on PULSAR_HOME. The script sets PULSAR_HOME to be the directory in which pulsar itself is installed; any existing value is ignored. As an end user, I cannot see why anyone would want to store their *user* data in the *application's* private directory tree; normal users won't even have permission to do so. If other components need to find each other relative to PULSAR_HOME, then it would be fine to set PULSAR_HOME without changing the working directory; but anything in the code which opens "foo/bar" would then have to change to opening "$PULSAR_HOME/foo/bar" > Will it work after remove change the working directory? Apparently not: ``` $ apache-pulsar-2.4.1/bin/pulsar-admin help 2019-11-14 08:15:24,677 main ERROR FileNotFoundException: language=JavaScript, path=./conf/log4j2-scripts/filter.js, actualCharset=UTF-8 2019-11-14 08:15:24,678 main ERROR Null object returned for ScriptFile in Scripts. Was passed main parameter 'help' but no main parameter was defined ``` That appears to come from here: ``` $ grep -R conf/log4j2-scripts/filter.js . ./conf/log4j2.yaml: path: ./conf/log4j2-scripts/filter.js ``` And I think I can see another relative path in there: ``` Properties: Property: - name: "pulsar.log.dir" value: "logs" ``` However, I don't code in Java. Even if it had worked for me once, that wouldn't prove it would work under all circumstances. As an end user, all I can say is that it would be helpful for me for the current working directory to be honoured. Only the developers can say whether changing the working directory to PULSAR_HOME is a necessary part of the implementation, or whether it could be changed easily and safely not to do so.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
