Skip to content

Commit

Permalink
Add default fallback values (/opt/rke2/bin, /opt/bin) to the PATH…
Browse files Browse the repository at this point in the history
… if `/usr/local/bin` is read-only (#195)

Signed-off-by: Chris Kim <[email protected]>
  • Loading branch information
Oats87 authored Sep 4, 2024
1 parent 864635c commit 7c3ac14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -860,9 +860,11 @@ create_env_file() {

# if /usr/local/ is ready only or on a separate partition, we want to add the bin dirs of rke2/k3s to our path
if check_target_mountpoint || check_target_ro; then
info "${DEFAULT_BIN_PREFIX} is unsuitable for installation: adding fallback path to systemd unit env file."
if [ -n "${CATTLE_AGENT_FALLBACK_PATH}" ]; then
info "${DEFAULT_BIN_PREFIX} is unsuitable for installation: adding fallback path to systemd unit env file."
echo "PATH=${PATH}:${CATTLE_AGENT_FALLBACK_PATH}" | tee -a ${FILE_SA_ENV} >/dev/null
else
echo "PATH=${PATH}:/opt/rke2/bin:/opt/bin" | tee -a ${FILE_SA_ENV} >/dev/null
fi
fi
}
Expand Down

0 comments on commit 7c3ac14

Please sign in to comment.