Skip to content

Commit 597bad6

Browse files
ZNeumannlavarou
andauthored
fix(installer): tarball installer checks for ini in mods-available (#971)
Debian uses a directory called "mods-available" to house ini files. It's `phpenmod` and `phpdismod` allow command-line management of extensions in directory. It also creates a symlink ini file to this "mods-available" directory in the normal conf.d directory. The issue is that this symlink is prefixed with a number (for example 20-newrelic.ini). This prefix prevents our tarball installer from recognizing that a newrelic.ini already exists, resulting in 2 ini files: a newrelic.ini and a 20-newrelic.ini. Our .deb package installer scouts out the "mods-available" directory and installs therein when possible. That means that if a customer installs via package but upgrades via tarball (not recommended), then their system gets the duplicates. This change makes our tarball installer scout for a potential previous installation in mods-available. Fixes #399 --------- Co-authored-by: Michal Nowacki <[email protected]>
1 parent 7a5f848 commit 597bad6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

agent/newrelic-install.sh

+19
Original file line numberDiff line numberDiff line change
@@ -1371,6 +1371,25 @@ EOF
13711371
if [ -d "${cfg_pfx}/fpm/conf.d" ]; then
13721372
pi_inidir_dso="${cfg_pfx}/fpm/conf.d"
13731373
fi
1374+
1375+
#
1376+
# Debian can use a mods-available directory to store the ini files.
1377+
# It creates a symlink from the ini file in the conf.d directory that
1378+
# our installer can fail to find (because the symlink is prefixed with
1379+
# "20-" (notably the number can change based on configurations).
1380+
# While this install script will not install into the mods-available
1381+
# directory, our .deb installer can. Therefore, we want to detect if
1382+
# newrelic has previously been installed in the mods-available directory
1383+
# so that we do not create an additional ini file -- which would result in
1384+
# the conf.d directory having both newrelic.ini and 20-newrelic.ini.
1385+
#
1386+
1387+
if [ -d "${cfg_pfx}/mods-available" -a -f "${cfg_pfx}/mods-available/newrelic.ini" ]; then
1388+
pi_inidir_cli="${cfg_pfx}/mods-available"
1389+
if [ -n "${pi_inidir_dso}" ]; then
1390+
pi_inidir_dso="${cfg_pfx}/mods-available"
1391+
fi
1392+
fi
13741393
fi
13751394
done
13761395

0 commit comments

Comments
 (0)