In order to install New Relic via systems like Puppet or Chef, the newrelic-install script can be run in silent mode and controlled via a number of environment variables. This document provides information for manually setting the environment variables to enable the PHP install script to run in silent mode.
Choose an installer
Two options are available when deploying New Relic via systems such as Puppet or Chef:
Use Puppet to install the archives using the native package manager (rpm or dpkg).
Distribute the contents of the tarball distribution and place the files in your selected location.
If you install via the package systems, the package install scripts place the files. Ubuntu-based systems are an exception, where the post-install script will create symbolic links for the New Relic extension if you have the standard PHP installed. However, it makes no attempt to run newrelic-install, as that is left up to your Puppet or Chef scripts.
In order to install New Relic via systems like Puppet or Chef, the newrelic-install script can be run in silent mode, and controlled via a number of environment variables.
Set environment variables
This is the list of environment variables you can set prior to invoking newrelic-install to control how it behaves. In addition to using these environment variables, ensure that you also define your license key and application name in your newrelic.ini file during installation.
Important
NR_INSTALL_SILENT determines whether the install runs in silent mode. When it is set, all information for the script must be provided via these environment variables.
Type:
flag
Default:
(none)
Use:
Set to any value to set flag to true.
If set, the script will run in silent mode. This will stifle the display of most status messages and not stop for user input.
When running in silent mode, all information for the script must be provided via these environment variables.
When set, you must invoke the script with either the install or uninstall command line option to set the execution mode.
Type:
flag
Default:
(none)
Use:
Set to any value to set flag to true.
If set, the script will not attempt to re-exec itself with the Bourne Again Shell (bash) or Korn Shell (ksh).
The script uses features not found in some traditional Bourne shell implementations, and by default tries to re-exec itself with a shell that is known to implement those features.
If you know that your /bin/sh is either ksh or bash, you can prevent this re-execution by setting this variable to any value.
Type:
path
Default:
(none)
Use:
Point the script to a compatible shell.
The install script relies on certain features that are not present in some very old Bourne shell implementations. If you are deploying on such a system, set this variable to point to a replacement shell that the script will re-exec itself with.
This variable will be ignored if NR_INSTALL_NOKSH is set.
If your version of /bin/sh is really a link pre 3.x versions of Zsh, you may need to set this to a more Korn-compatible shell such as Bash.
Type:
colon-separated list of directories
Default:
(none)
Use:
List directories to add to $PATH.
Contains a colon-separated list of directories to add to the current $PATH in which to look for PHP installations.
If you have a PHP installation in a non-standard location that isn't in the $PATH at the time you invoke the script from Puppet or Chef, then you can set this variable. You can also edit the PATH directly to contain those directories.
Type:
colon-separated list of directories
Default:
(none)
Use:
List directories in which to install New Relic.
Contains a colon-separated list of directories in which to install New Relic.
If set, it contains the exclusive list, and any versions found on the PATH or in directories specified in NR_INSTALL_PATH will be ignored.
Type:
string
Default:
(none)
Use:
Set to either x86 or x64 to override script-based detection.
This will override the attempt to determine the architecture automatically.
If you are running on a 64-bit system and you set this to x86, you will force the script to install the 32-bit daemon (if you are installing from tarballs) and agent.
Setting it to x64 will install the 64-bit daemon and allow the script to detect whether your PHP version is 64-bit or 32-bit.
You should not need to set this. It is provided for completeness.
Type:
string
Default:
(none)
Use:
Set to your New Relic on new installs.
If this is a fresh installation and a new newrelic.ini file needs to be created, set this value to the license key.
Type:
string
Default:
(none)
Use:
Specify the name of target startup daemon.
Contains the name of the daemon startup script.
Use this if you do not want to use the default name.
Type:
path
Default:
(none)
Use:
Specify the full install path of the New Relic proxy daemon.
Contains the full path of the New Relic proxy daemon install path.
For all systems except Solaris, the default is /usr/bin/newrelic-daemon. For Solaris the default is /opt/newrelic/bin/newrelic-daemon.
If you change this you may need to edit the init scripts or their configuration files.
Type:
flag
Default:
(none)
Use:
Set to any value to set flag to true.
Instructs the install script to copy the agent into place rather than using symbolic links. This is useful if you have extracted the agent into some location (such as the root user's home directory) that isn't accessible to the PHP process.