diff --git a/recipes/newrelic/infrastructure/amazonlinux2.yml b/recipes/newrelic/infrastructure/amazonlinux2.yml index 993c6401e..d0e4f61e4 100644 --- a/recipes/newrelic/infrastructure/amazonlinux2.yml +++ b/recipes/newrelic/infrastructure/amazonlinux2.yml @@ -78,6 +78,12 @@ install: echo "systemctl is required to install the newrelic infrastructure agent. Installation cannot proceed on this linux version." >> /dev/stderr exit 20 fi + - | + IS_SYSTEMCTL_AVAILABLE=$(sudo systemctl status | grep -i running | wc -l) + if [ $IS_SYSTEMCTL_AVAILABLE -eq 0 ] ; then + echo "systemctl is required to install the newrelic infrastructure agent. System has not been booted with systemd as init system. Installation cannot proceed on this linux version." >> /dev/stderr + exit 20 + fi setup_license: cmds: diff --git a/recipes/newrelic/infrastructure/centos_rhel.yml b/recipes/newrelic/infrastructure/centos_rhel.yml index da4203b85..751d7c795 100644 --- a/recipes/newrelic/infrastructure/centos_rhel.yml +++ b/recipes/newrelic/infrastructure/centos_rhel.yml @@ -98,6 +98,12 @@ install: echo "there is no newrelic infrastructure agent available for the distribution '{{.DISTRO_VERSION}}'." >> /dev/stderr exit 21 fi + - | + IS_SYSTEMCTL_AVAILABLE=$(sudo systemctl status | grep -i running | wc -l) + if [ $IS_SYSTEMCTL_AVAILABLE -eq 0 ] ; then + echo "systemctl is required to install the newrelic infrastructure agent. System has not been booted with systemd as init system. Installation cannot proceed on this linux version." >> /dev/stderr + exit 20 + fi vars: DISTRO_VERSION: sh: | diff --git a/recipes/newrelic/infrastructure/debian.yml b/recipes/newrelic/infrastructure/debian.yml index 43f745f4b..e8d39603d 100644 --- a/recipes/newrelic/infrastructure/debian.yml +++ b/recipes/newrelic/infrastructure/debian.yml @@ -80,6 +80,12 @@ install: echo "systemctl is required to install the newrelic infrastructure agent. Installation cannot proceed on this linux version." >> /dev/stderr exit 20 fi + - | + IS_SYSTEMCTL_AVAILABLE=$(sudo systemctl status | grep -i running | wc -l) + if [ $IS_SYSTEMCTL_AVAILABLE -eq 0 ] ; then + echo "systemctl is required to install the newrelic infrastructure agent. System has not been booted with systemd as init system. Installation cannot proceed on this linux version." >> /dev/stderr + exit 20 + fi - | if [ -n "{{.DEBIAN_CODENAME}}" ]; then IS_INFRA_AVAILABLE=$(curl -Is https://download.newrelic.com/infrastructure_agent/linux/apt/dists/{{.DEBIAN_CODENAME}}/InRelease | grep " 2[0-9][0-9] " | wc -l) diff --git a/recipes/newrelic/infrastructure/suse.yml b/recipes/newrelic/infrastructure/suse.yml index 59dec6ef7..c77ff6722 100644 --- a/recipes/newrelic/infrastructure/suse.yml +++ b/recipes/newrelic/infrastructure/suse.yml @@ -78,6 +78,12 @@ install: echo "systemctl is required to install the newrelic infrastructure agent. Installation cannot proceed on this linux version." >> /dev/stderr exit 20 fi + - | + IS_SYSTEMCTL_AVAILABLE=$(sudo systemctl status | grep -i running | wc -l) + if [ $IS_SYSTEMCTL_AVAILABLE -eq 0 ] ; then + echo "systemctl is required to install the newrelic infrastructure agent. System has not been booted with systemd as init system. Installation cannot proceed on this linux version." >> /dev/stderr + exit 20 + fi - | IS_INFRA_AVAILABLE=$(curl -Is https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/{{.SLES_VERSION}}/x86_64/newrelic-infra.repo | grep " 2[0-9][0-9] " | wc -l) if [ $IS_INFRA_AVAILABLE -eq 0 ] ; then diff --git a/recipes/newrelic/infrastructure/ubuntu.yml b/recipes/newrelic/infrastructure/ubuntu.yml index 78f8f8eb8..5bbca47ec 100644 --- a/recipes/newrelic/infrastructure/ubuntu.yml +++ b/recipes/newrelic/infrastructure/ubuntu.yml @@ -84,6 +84,14 @@ install: exit 20 fi fi + - | + if [ {{.DISTRIB_RELEASE}} -gt 14.04 ]; then + IS_SYSTEMCTL_AVAILABLE=$(sudo systemctl status | grep -i running | wc -l) + if [ $IS_SYSTEMCTL_AVAILABLE -eq 0 ] ; then + echo "systemctl is required to install the newrelic infrastructure agent. System has not been booted with systemd as init system. Installation cannot proceed on this linux version." >> /dev/stderr + exit 20 + fi + fi - | IS_INFRA_AVAILABLE=$(curl -Is https://download.newrelic.com/infrastructure_agent/linux/apt/dists/{{.DEBIAN_CODENAME}}/InRelease | grep " 2[0-9][0-9] " | wc -l) if [ $IS_INFRA_AVAILABLE -eq 0 ] ; then