dynatrace-oss / cloud-snippets

Apache License 2.0
2 stars 15 forks source link

Pclouds 2683 app service linux write bash script to determine linux distribution #9

Closed emjot13-dynatrace closed 1 year ago

emjot13-dynatrace commented 1 year ago

Wrote a bash script that detects which standard C library (musl/glibc) is used in the Azure Linux App Service container and then sets the DT_FLAVOR value accordingly.

It works in the following way:

  1. Parseldd --version output -> ldd is a utility that prints the shared libraries and it should contain information about libc
  2. If we didn't get the answer from ldd we check the /etc/os-release file and check if it's an alpine based distro as the musl library is usually present in those.
  3. If we still don't know we check if etc/alpine-release is present for the same reason as before.
dynatrace-cla-bot commented 1 year ago

CLA assistant check
All committers have signed the CLA.

olegkozel commented 1 year ago

Can you rename the script to oneagent_installer.sh and put it in azure/linux-app-service/oneagent_installer.sh? So if we will add more scripts to this repo it will be better categorized

emjot13-dynatrace commented 1 year ago

Fixed in https://github.com/dynatrace-oss/cloud-snippets/commit/844b8f0baba5513f65c592509befd1b75076304f

Can you rename the script to oneagent_installer.sh and put it in azure/linux-app-service/oneagent_installer.sh? So if we will add more scripts to this repo it will be better categorized