Skip to content

AzureMonitorAgent shim.sh not working on RHEL8 when different python3/2 is installed #2117

@Klaas-

Description

@Klaas-

Hi,
in the shim.sh of azure monitor agent you are making the following assumptions:

if command -v python3 >/dev/null 2>&1 ; then
eval ${python_exec_command}="python3"
elif command -v python2 >/dev/null 2>&1 ; then
eval ${python_exec_command}="python2"
elif command -v /usr/libexec/platform-python >/dev/null 2>&1 ; then
# If a user-installed python isn't available, check for a platform-python. This is typically only used in RHEL 8.0.
echo "User-installed python not found. Using /usr/libexec/platform-python as the python interpreter."
eval ${python_exec_command}="/usr/libexec/platform-python"
fi

about python

You can't do them at least on a RHEL8 python3 is not the python being used to waagent (on which python modules you rely in your code).
I am guessing you need to look at which python is being used by the azure agent and then use the same one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions