Silent mode for the install script (advanced)

This document is intended for advanced system administrators who will be deploying New Relic via systems such as Puppet or Chef. It is not intended for a casual audience.

This document provides information for manually setting environment variables to enable the PHP install script to run in silent mode. For detailed information, see The newrelic-install script.

Choosing 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 intentionally do very little other than place 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 facilitate getting New Relic installed properly on such systems, the newrelic-install script can be run in silent mode, and controlled via a number of environment variables.

You can also create your own scripts to put the right files in the right places for your system, but writing such scripts is beyond the scope of this document.

What follows is the list of environment variables you can set prior to invoking newrelic-install to control how it behaves.

Usable environment variables

These environment variables are used by the New Relic install script to manually configure your install.

Note: NR_INSTALL_SILENT determines when to run in silent mode. When it is set, all information for the script must be provided via these environment variables.

NR_INSTALL_SILENT
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.

NR_INSTALL_NOKSH
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.

NR_INSTALL_SHELL
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 the Z-shell, you may need to set this to a more Korn-compatible shell such as bash.

NR_INSTALL_PATH
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.

NR_INSTALL_PHPLIST
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.

NR_INSTALL_ARCH
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.

NR_INSTALL_KEY
Type: string
Default: (none)
Use: Set to your New Relic license key 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.

NR_INSTALL_INITSCRIPT
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.

NR_INSTALL_DAEMONPATH
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.

NR_INSTALL_USE_CP_NOT_LN
Type: string
Default: (none)
Use: Name of target startup daemon.

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.

For more help

Additional documentation resources include:

Join the discussion about PHP in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

If you need additional help, get support at support.newrelic.com.