mingyen066 opened a new pull request, #20945: URL: https://github.com/apache/kafka/pull/20945
`sapmachine` doesn't support JDK, so we switched to use `eclipse-temurin` so that previous AK versions such as AK 3.9 can use the same image provider. We also use symlinks to fix the java path problem for `eclipse-temurin`, based on a solution proposed by @unknowntpo. # Java path problem and its solution After switching to `eclipse-temurin`, we encountered a 'java not found' problem. This was unexpected because we had already written PATH to `~/.ssh/environment` and set `PermitUserEnvironment yes` in `sshd_config`. It turns out that the PAM (Pluggable Authentication Modules) re-reads `/etc/environment` after `~/.ssh/environment`. Unfortunately, there is a PATH variable in `/etc/environment` in ubuntu, which overwrites the PATH from `~/.ssh/environment`. Some images didn't have this problem because the java path was already in PATH before we changed it. The possible solutions are: * Prevent PAM from reading `/etc/environment` by editing `/etc/pam.d/sshd` * Write PATH to `~/.pam_environment` (ref: [help.ubuntu article](https://help.ubuntu.com/community/EnvironmentVariables#A.2BAH4-.2F.pam_environment)) * Write PATH to `/etc/environment/` * Add a symlink so that java is found without changing PATH However, we think first two solutions are prone to being distribution-specific. Modifying /etc/environment affects all users' PATH, which is not ideal. Therefore, we adopt the symlink solution suggested by @unknowntpo -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
