diff --git a/distribution/deb/pom.xml b/distribution/deb/pom.xml
index 2567fa996ab..46173b033f1 100644
--- a/distribution/deb/pom.xml
+++ b/distribution/deb/pom.xml
@@ -139,6 +139,12 @@
root
+
+ template
+
+ ${packaging.elasticsearch.conf.dir}/scripts
+
+
${project.build.directory}/generated-packaging/deb/env/elasticsearch
diff --git a/distribution/rpm/pom.xml b/distribution/rpm/pom.xml
index f073561cf47..b682ec32201 100644
--- a/distribution/rpm/pom.xml
+++ b/distribution/rpm/pom.xml
@@ -144,6 +144,10 @@
+
+ ${packaging.elasticsearch.conf.dir}/scripts
+ noreplace
+
/etc/sysconfig/