Skip to content

Commit

Permalink
Move Metricbeat modules.d dir to /etc/metricbeat (elastic#8105)
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 elastic#8104
  • Loading branch information
andrewkroh committed Aug 29, 2018
1 parent 55e8a38 commit ac96597
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 @@ -66,6 +66,7 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff]
- Recover metrics for old apache versions removed by mistake on #6450. {pull}7871[7871]
- Add missing namespace field in http server metricset {pull}7890[7890]
- 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]
- Add docker diskio stats on Windows. {issue}6815[6815] {pull}8126[8126]

*Packetbeat*
Expand Down
11 changes: 4 additions & 7 deletions metricbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ func GoTestIntegration(ctx context.Context) 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 @@ -176,10 +175,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 ac96597

Please sign in to comment.