Amazon Linux 2 ARM 64位上的新Relic Silent安装

uqjltbpv  于 2023-06-21  发布在  Linux
关注(0)|答案(1)|浏览(152)

我试图在Amazon Linux 2(ARM 64)上以静默模式安装New Relic PHP代理,但不幸的是它正在进入交互模式。我已经设置了doc中提到的环境变量。以下是我所遵循的步骤,我错过了什么吗?

export NR_INSTALL_PATH=/usr/bin
export NR_INSTALL_SILENT=1
export NR_INSTALL_KEY=XXYYZZ

wget https://download.newrelic.com/php_agent/release/newrelic-php5-10.10.0.1-linux.tar.gz
gzip -dc newrelic-php5-10.10.0.1-linux.tar.gz | tar xf -
cd newrelic-php5-10.10.0.1-linux/
sudo ./newrelic-install install

输出(这些步骤使我进入交互模式安装,但我想进行静默安装):

New Relic PHP Agent Installation (interactive mode)
===================================================

   Enter New Relic license key (or leave blank):
eivgtgni

eivgtgni1#

由sudo启动的进程不会继承环境变量,除非显式配置为这样做。

# Tell sudo to keep the desired environment variables with least contamination
sudo --preserve-env=NR_INSTALL_PATH,NR_INSTALL_SILENT,NR_INSTALL_KEY ./newrelic-install install

# Shorter command, but risk of contamination (especially PATH)
sudo -E ./newrelic-install install

如果sudo用户没有保留环境变量的权限(sudoers安全策略),我们可以使用env手动设置。

sudo env NR_INSTALL_PATH=/usr/bin NR_INSTALL_SILENT=1 NR_INSTALL_KEY=XXYYZZ ./newrelic-install install

相关问题