Skip to content

Package PREIN Distribution Check Fails when /etc/issue is non standard. #103

@joebeard

Description

@joebeard

Installation of datadog agent fails due to the method of checking for distribution in the pre-install script:

https://github.com/DataDog/dd-agent-omnibus/blob/master/package-scripts/datadog-agent/preinst#L7

Which doesn't leave much room for custom /etc/issue files and I would like to respectfully ask this is reviewed to either make it more flexible or more use more OS resources to verify the specific release.

In our instance the /etc/issue file is built by Chef and includes the line:

System Info: rhel amazon 2016.09

Which is built from the following chef template configuration (the template itself has a legal warning followed by system info):

template "/etc/issue" do
  source "issue"
  mode 0644
  variables(
    "platform" => node["platform"],
    "platform_version" => node["platform_version"],
    "platform_family" => node["platform_family"]
  )
end

We use the same base cookbook across multiple distributions.

Unfortunately here the case doesn't match. An alternative file to check on Amazon Linux would be /etc/system-release which contains:

Amazon Linux AMI release 2016.09

A simple fix would be just to add case insensitivity to the grep statement which would fix my use case but that is selfish and suggest checking:

  • lsb_release (if installed)
  • All /etc/*-release files present
  • /etc/issue
  • uname -s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions