Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Cannot install infrastructure agent on Amazon Linux - RPM upstart issue?

ubuntu
newrelic-infra
infrastructure

#1

I followed the instructions here and get an error installing that leads me to think the RPM is not made properly for Upstart based systems like Amazon Linux (looking for systemctl). I just updated to the latest version of Amazon Linux and it’s the same

$ cat /etc/system-release
Amazon Linux AMI release 2017.03

https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/installation/install-infrastructure-linux

$ sudo yum install newrelic-infra -y
Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package newrelic-infra.x86_64 0:1.0.677-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================
 Package                             Arch                        Version                           Repository                           Size
=============================================================================================================================================
Installing:
 newrelic-infra                      x86_64                      1.0.677-1                         newrelic-infra                       14 M

Transaction Summary
=============================================================================================================================================
Install  1 Package

Total download size: 14 M
Installed size: 42 M
Downloading packages:
newrelic-infra-1.0.677-1.x86_64.rpm                                                                                   |  14 MB     00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : newrelic-infra-1.0.677-1.x86_64                                                                                           1/1
/var/tmp/rpm-tmp.mF5ohq: line 4: systemctl: command not found
warning: %posttrans(newrelic-infra-0:1.0.677-1.x86_64) scriptlet failed, exit status 127
Non-fatal POSTTRANS scriptlet failure in rpm package newrelic-infra-1.0.677-1.x86_64
  Verifying  : newrelic-infra-1.0.677-1.x86_64                                                                                           1/1

Installed:
  newrelic-infra.x86_64 0:1.0.677-1

Complete!

Agent is not installed

$ sudo initctl status newrelic-infra
initctl: Unknown job: newrelic-infra

#2

Hi,

Can you check your /etc/yum.repos.d/newrelic-infra.repo and see if it contains the following?

[newrelic-infra]
name=New Relic Infrastructure
baseurl=http://download.newrelic.com/infrastructure_agent/linux/yum/el/6/x86_64
gpgkey=http://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg
gpgcheck=1
repo_gpgcheck=1

The OS for AWS Linux 2017.03 uses Upstart. I have verified that. This means that the appropriate command for starting the agent should be “initctl”

Since the installation is saying that it is trying to use systemctl it leads me to believe you may have grabbed the wrong line in the installation instructions. If you used the line for CentOS / RHEL instead of Amazon you might end up with the following in the newrelic0infra.repo file

baseurl=http://download.newrelic.com/infrastructure_agent/linux/yum/el/7/x86_64

This would cause a download for the version that uses Systemd which does use systemctl.

If my suspicions are correct, then you will have to remove the current agent version using yum remove newrelic-infra. Then either:

  • step through the instructions for the installation again making certain you use Amazon Linux, or

  • edit the newrelic-infra.repo file and change the baseurl line from .../yum/el/7/x86_64... to .../yum/el/6/x86_64... Then execute:

sudo yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra
sudo yum install newrelic-infra -y

I hope that information helps.


#3

Wow, expertly diagnosed. I hadn’t noticed the Amazon line in the instructions on setting up the right repo. I’m all set now. Thank you!


#5

I am having the same problem, I’m using the Linux AMI

$ cat /etc/system-release
Amazon Linux AMI release 2018.03

/etc/yum.repos.d/newrelic-infra.repo file is as follows:

[newrelic-infra]
name=New Relic Infrastructure
baseurl=http://download.newrelic.com/infrastructure_agent/linux/yum/el/6/x86_64
gpgkey=http://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg
gpgcheck=1
repo_gpgcheck=1

.

$ sudo initctl status newrelic-infra
initctl: Unknown job: newrelic-infra