From 6bbc227cfd2cab639e61f3f65aefd6e5e3d92efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Nasiadka?= Date: Fri, 5 May 2023 22:52:31 +0200 Subject: [PATCH] Make systemd-tmpfiles optional (#3435) Signed-off-by: Michal Nasiadka --- .../opensearch-dashboards/deb/debian/postinst | 4 +++- .../rpm/opensearch-dashboards.rpm.spec | 4 +++- scripts/pkg/build_templates/opensearch/deb/debian/postinst | 5 ++++- .../pkg/build_templates/opensearch/rpm/opensearch.rpm.spec | 6 +++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/pkg/build_templates/opensearch-dashboards/deb/debian/postinst b/scripts/pkg/build_templates/opensearch-dashboards/deb/debian/postinst index 39953137f6..30d62c95e7 100755 --- a/scripts/pkg/build_templates/opensearch-dashboards/deb/debian/postinst +++ b/scripts/pkg/build_templates/opensearch-dashboards/deb/debian/postinst @@ -25,7 +25,9 @@ if command -v systemctl > /dev/null; then fi # Reload other configs -systemd-tmpfiles --create opensearch-dashboards.conf +if command -v systemd-tmpfiles > /dev/null; then + systemd-tmpfiles --create opensearch-dashboards.conf +fi # Messages echo "### NOT starting on installation, please execute the following statements to configure opensearch-dashboards service to start automatically using systemd" diff --git a/scripts/pkg/build_templates/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec b/scripts/pkg/build_templates/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec index 6e019a2348..6ff7c32084 100644 --- a/scripts/pkg/build_templates/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec +++ b/scripts/pkg/build_templates/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec @@ -80,7 +80,9 @@ if command -v systemctl > /dev/null; then systemctl daemon-reload fi # Reload other configs -systemd-tmpfiles --create %{name}.conf +if command -v systemd-tmpfiles > /dev/null; then + systemd-tmpfiles --create %{name}.conf +fi # Messages echo "### NOT starting on installation, please execute the following statements to configure opensearch-dashboards service to start automatically using systemd" echo " sudo systemctl daemon-reload" diff --git a/scripts/pkg/build_templates/opensearch/deb/debian/postinst b/scripts/pkg/build_templates/opensearch/deb/debian/postinst index 65d254d9a5..cc84020eb7 100755 --- a/scripts/pkg/build_templates/opensearch/deb/debian/postinst +++ b/scripts/pkg/build_templates/opensearch/deb/debian/postinst @@ -53,7 +53,10 @@ fi if command -v systemctl > /dev/null; then systemctl restart systemd-sysctl.service || true fi -systemd-tmpfiles --create opensearch.conf + +if command -v systemd-tmpfiles > /dev/null; then + systemd-tmpfiles --create opensearch.conf +fi # Messages echo "### NOT starting on installation, please execute the following statements to configure opensearch service to start automatically using systemd" diff --git a/scripts/pkg/build_templates/opensearch/rpm/opensearch.rpm.spec b/scripts/pkg/build_templates/opensearch/rpm/opensearch.rpm.spec index aef6dbd4b1..f2df1879e0 100644 --- a/scripts/pkg/build_templates/opensearch/rpm/opensearch.rpm.spec +++ b/scripts/pkg/build_templates/opensearch/rpm/opensearch.rpm.spec @@ -117,7 +117,11 @@ fi if command -v systemctl > /dev/null; then systemctl restart systemd-sysctl.service || true fi -systemd-tmpfiles --create %{name}.conf + +if command -v systemd-tmpfiles > /dev/null; then + systemd-tmpfiles --create %{name}.conf +fi + # Messages echo "### NOT starting on installation, please execute the following statements to configure opensearch service to start automatically using systemd" echo " sudo systemctl daemon-reload"