Skip to content

Commit

Permalink
Merge pull request #265 from newrelic/chore/ensure-systemctl-running
Browse files Browse the repository at this point in the history
Ensure systemctl is up and running (handle WSL ubuntu)
  • Loading branch information
Julien4218 authored Mar 17, 2021
2 parents f16cd10 + 3367620 commit 9bd4614
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions recipes/newrelic/infrastructure/amazonlinux2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions recipes/newrelic/infrastructure/centos_rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
6 changes: 6 additions & 0 deletions recipes/newrelic/infrastructure/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions recipes/newrelic/infrastructure/suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions recipes/newrelic/infrastructure/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9bd4614

Please sign in to comment.