diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index e5d6be70b24..6150971bc6b 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -211,6 +211,7 @@ automatic splitting at root level, if root level element is an array. {pull}3415 - Added append Processor which will append concrete values or values from a field to target. {issue}29934[29934] {pull}33364[33364] - When running under Elastic-Agent the status is now reported per Unit instead of the whole Beat {issue}35874[35874] {pull}36183[36183] +- Add warning message to SysV init scripts for RPM-based systems that lack `/etc/rc.d/init.d/functions`. {issue}35708[35708] {pull}36188[36188] *Auditbeat* diff --git a/dev-tools/packaging/templates/rpm/elastic-agent.init.sh.tmpl b/dev-tools/packaging/templates/rpm/elastic-agent.init.sh.tmpl index 573f0c9496b..25c87d29fd9 100644 --- a/dev-tools/packaging/templates/rpm/elastic-agent.init.sh.tmpl +++ b/dev-tools/packaging/templates/rpm/elastic-agent.init.sh.tmpl @@ -17,6 +17,13 @@ # family. Please see: https://www.elastic.co/beats ### END INIT INFO +# Exit with an informative message if functions does not exist. +# This has been removed from RHEL9, but exists on other RPM-based +# distributions in the support matrix. +if [ ! -f /etc/rc.d/init.d/functions ]; then + echo "SysV-style init script service management is not supported on this system, use systemctl instead" + exit 1 +fi PATH=/usr/bin:/sbin:/bin:/usr/sbin diff --git a/dev-tools/packaging/templates/rpm/init.sh.tmpl b/dev-tools/packaging/templates/rpm/init.sh.tmpl index 1bd3a846705..8e4c9731e9c 100644 --- a/dev-tools/packaging/templates/rpm/init.sh.tmpl +++ b/dev-tools/packaging/templates/rpm/init.sh.tmpl @@ -17,6 +17,13 @@ # family. Please see: https://www.elastic.co/beats ### END INIT INFO +# Exit with an informative message if functions does not exist. +# This has been removed from RHEL9, but exists on other RPM-based +# distributions in the support matrix. +if [ ! -f /etc/rc.d/init.d/functions ]; then + echo "SysV-style init script service management is not supported on this system, use systemctl instead" + exit 1 +fi PATH=/usr/bin:/sbin:/bin:/usr/sbin