Skip to content

Commit

Permalink
Move Metricbeat modules.d dir to /etc/metricbeat (#8105) (#8152)
Browse files Browse the repository at this point in the history
This fixes the location of the Metricbeat modules.d directory as installed by .deb and .rpm packages.

Fixes #8104

(cherry picked from commit ac96597)
  • Loading branch information
andrewkroh authored and exekias committed Sep 3, 2018
1 parent 4592ded commit cce78ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ https://github.com/elastic/beats/compare/v6.4.0...6.4[Check the HEAD diff]

- Fix golang.heap.gc.cpu_fraction type from long to float in Golang module. {pull}7789[7789]
- Fixed the RPM by designating the modules.d config files as configuration data in the RPM spec. {issue}8075[8075]
- Fixed the location of the modules.d dir in Deb and RPM packages. {issue}8104[8104]

*Packetbeat*

Expand Down
11 changes: 4 additions & 7 deletions metricbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,8 @@ func Fields() error {
// not supported.
func customizePackaging() {
var (
archiveModulesDir = "modules.d"
linuxPkgModulesDir = "/usr/share/{{.BeatName}}/modules.d"
darwinDMGModulesDir = "/Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/modules.d"
archiveModulesDir = "modules.d"
unixModulesDir = "/etc/{{.BeatName}}/modules.d"

modulesDir = mage.PackageFile{
Mode: 0644,
Expand Down Expand Up @@ -156,10 +155,8 @@ func customizePackaging() {
switch pkgType {
case mage.TarGz, mage.Zip:
args.Spec.Files[archiveModulesDir] = modulesDir
case mage.Deb, mage.RPM:
args.Spec.Files[linuxPkgModulesDir] = modulesDir
case mage.DMG:
args.Spec.Files[darwinDMGModulesDir] = modulesDir
case mage.Deb, mage.RPM, mage.DMG:
args.Spec.Files[unixModulesDir] = modulesDir
default:
panic(errors.Errorf("unhandled package type: %v", pkgType))
}
Expand Down

0 comments on commit cce78ae

Please sign in to comment.