Skip to content

Commit 5bec1fd

Browse files
Rename linux install packages (#1180)
* Initial renaming * Fix one file, debs are building now * Prevent old and new packages from being installed at the same time * Add migration of previous user data for .deb * Handle data migration in RPM case * Update package deploy script * Find and replace some other uses of netcore20 * Update CHANGELOG.md Co-authored-by: Vu Tran <[email protected]>
1 parent 0074742 commit 5bec1fd

File tree

16 files changed

+89
-34
lines changed

16 files changed

+89
-34
lines changed

FullAgent.sln

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NewRelic.Api.Agent", "src\A
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Miscellaneous", "Miscellaneous", "{D8E8DC37-B021-4C1D-8E32-6F9DF0F0A2BD}"
1111
ProjectSection(SolutionItems) = preProject
12-
src\Agent\Miscellaneous\netcore20-agent-readme.md = src\Agent\Miscellaneous\netcore20-agent-readme.md
12+
src\Agent\Miscellaneous\core-agent-readme.md = src\Agent\Miscellaneous\core-agent-readme.md
1313
src\Agent\Miscellaneous\NewRelic-icon-16x16.ico = src\Agent\Miscellaneous\NewRelic-icon-16x16.ico
1414
src\Agent\Miscellaneous\NewRelic.Providers.Wrapper.Misc.Instrumentation.xml = src\Agent\Miscellaneous\NewRelic.Providers.Wrapper.Misc.Instrumentation.xml
1515
EndProjectSection

build/ArtifactBuilder/Artifacts/LinuxPackage.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public LinuxPackage(string name, string packagePlatform, string fileExtension) :
2121
protected override void InternalBuild()
2222
{
2323
//Note that the wildcard purposely includes the separator and the version number
24-
var fileNameSearchPattern = $"newrelic-netcore20-agent*{_packagePlatform}.{_fileExtension}";
24+
var fileNameSearchPattern = $"newrelic-dotnet-agent*{_packagePlatform}.{_fileExtension}";
2525
var packagePath = Directory.GetFiles(_buildOutputDirectory, fileNameSearchPattern).FirstOrDefault();
2626

2727
if (string.IsNullOrEmpty(packagePath))

build/Linux/build/common/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
# This script can be used to run a dotnet application with New Relic monitoring.
44

5-
CORECLR_NEWRELIC_HOME=${CORECLR_NEWRELIC_HOME:-/usr/local/newrelic-netcore20-agent} CORECLR_ENABLE_PROFILING=1 CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A} CORECLR_PROFILER_PATH=$CORECLR_NEWRELIC_HOME/libNewRelicProfiler.so $@
5+
CORECLR_NEWRELIC_HOME=${CORECLR_NEWRELIC_HOME:-/usr/local/newrelic-dotnet-agent} CORECLR_ENABLE_PROFILING=1 CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A} CORECLR_PROFILER_PATH=$CORECLR_NEWRELIC_HOME/libNewRelicProfiler.so $@

build/Linux/build/deb/build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
ARCH='amd64'
44
AGENT_HOMEDIR='newrelichome_x64_coreclr_linux'
5-
PACKAGE_NAME='newrelic-netcore20-agent'
5+
PACKAGE_NAME='newrelic-dotnet-agent'
66

77
if [ "$1" = "arm64" ]; then
88
ARCH="arm64"
@@ -39,7 +39,7 @@ rm -rf logs Logs
3939

4040
cp /common/setenv.sh .
4141
cp /common/run.sh .
42-
cp /docs/netcore20-agent-readme.md ./README.md
42+
cp /docs/core-agent-readme.md ./README.md
4343

4444
dos2unix *.x* extensions/*.x* *.sh
4545

build/Linux/build/deb/conffiles

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/usr/local/newrelic-netcore20-agent/newrelic.config
1+
/usr/local/newrelic-dotnet-agent/newrelic.config

build/Linux/build/deb/control

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ Maintainer: New Relic <[email protected]>
22
Architecture: all
33
Description: The New Relic .NET Agent for CoreCLR
44
Section: non-free
5-
Homepage: http://www.newrelic.com/
5+
Homepage: http://www.newrelic.com/
6+
Conflicts: newrelic-netcore20-agent
7+
Replaces: newrelic-netcore20-agent

build/Linux/build/deb/postinst

+33-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,45 @@
11
#!/bin/bash
22

3-
PACKAGE_NAME='newrelic-netcore20-agent'
3+
PACKAGE_NAME='newrelic-dotnet-agent'
4+
OBSOLETE_PACKAGE_NAME='newrelic-netcore20-agent'
45
NEWRELIC_HOME=/usr/local/${PACKAGE_NAME}
5-
6-
# Deprecated instrumentation files to remove post install
7-
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.Instrumentation.xml 2> /dev/null
8-
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.dll 2> /dev/null
6+
OBSOLETE_NEWRELIC_HOME=/usr/local/${OBSOLETE_PACKAGE_NAME}
97

108
# create logs dir
119
mkdir -p $NEWRELIC_HOME/logs 2> /dev/null
1210

13-
if [ ! -L /var/log/newrelic/dotnet ]; then
14-
mkdir -p /var/log/newrelic 2> /dev/null
15-
ln -sTf $NEWRELIC_HOME/logs /var/log/newrelic/dotnet 2> /dev/null
11+
# create symlink to logs dir in /var/log/newrelic
12+
mkdir -p /var/log/newrelic 2> /dev/null
13+
ln -sTf $NEWRELIC_HOME/logs /var/log/newrelic/dotnet 2> /dev/null
14+
15+
# remove old profile.d file if it exists
16+
oldHomeDirFile="/etc/profile.d/${OBSOLETE_PACKAGE_NAME}-path.sh"
17+
if [ -e $oldHomeDirFile ]; then
18+
echo "Cleaning up $oldHomeDirFile"
19+
rm -f $oldHomeDirFile
1620
fi
1721

18-
echo "export CORECLR_NEWRELIC_HOME=/usr/local/${PACKAGE_NAME}" > /etc/profile.d/${PACKAGE_NAME}-path.sh
22+
# migrate data from obsoleted package, if applicable
23+
if [ -d $OBSOLETE_NEWRELIC_HOME ]; then
24+
echo "Migrating user data from $OBSOLETE_NEWRELIC_HOME"
25+
26+
# migrate config file, backing up original first
27+
if [ -e $OBSOLETE_NEWRELIC_HOME/newrelic.config ]; then
28+
mv $NEWRELIC_HOME/newrelic.config $NEWRELIC_HOME/newrelic.config.original
29+
cp -v $OBSOLETE_NEWRELIC_HOME/newrelic.config $NEWRELIC_HOME/newrelic.config
30+
fi
31+
32+
# migrate any custom instrumentation
33+
if [ -d $OBSOLETE_NEWRELIC_HOME/extensions ]; then
34+
cp -nv $OBSOLETE_NEWRELIC_HOME/extensions/*.xml $NEWRELIC_HOME/extensions
35+
fi
36+
fi
37+
38+
# Deprecated instrumentation files to remove post install
39+
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.Instrumentation.xml 2> /dev/null
40+
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.dll 2> /dev/null
41+
42+
echo "export CORECLR_NEWRELIC_HOME=${NEWRELIC_HOME}" > /etc/profile.d/${PACKAGE_NAME}-path.sh
1943
source /etc/profile.d/${PACKAGE_NAME}-path.sh
2044

2145
chmod o+w $NEWRELIC_HOME/logs

build/Linux/build/rpm/build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ EXPECT
3434
./sign.expect
3535
}
3636

37-
PACKAGE_NAME='newrelic-netcore20-agent'
37+
PACKAGE_NAME='newrelic-dotnet-agent'
3838
AGENT_HOMEDIR='newrelichome_x64_coreclr_linux'
3939

4040
if [ -z "$AGENT_VERSION" ]; then
@@ -76,7 +76,7 @@ rm -rf logs Logs
7676

7777
cp /common/setenv.sh .
7878
cp /common/run.sh .
79-
cp /docs/netcore20-agent-readme.md ./README.md
79+
cp /docs/core-agent-readme.md ./README.md
8080

8181
dos2unix *.x* extensions/*.x* *.sh
8282

build/Linux/build/rpm/newrelic-netcore20-agent.spec renamed to build/Linux/build/rpm/newrelic-dotnet-agent.spec

+35-10
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
%define debug_package %{nil}
44
%define __os_install_post %{_dbpath}/brp-compress
55

6-
Name: newrelic-netcore20-agent
6+
Name: newrelic-dotnet-agent
77
Version: %{getenv:AGENT_VERSION}
88
Release: 1
99
License: Apache Software License 2.0
1010
Vendor: New Relic, Inc.
1111
Group: Development/Languages
12-
Summary: The New Relic .NET agent for .NET Core
12+
Summary: The New Relic agent for .NET Core
13+
Obsoletes: newrelic-netcore20-agent
1314

1415
URL: http://newrelic.com/
1516
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -19,7 +20,7 @@ SOURCE0: %{name}-%{version}.tar.gz
1920

2021
%description
2122
The New Relic .NET agent monitors applications running
22-
on .NET Core 2.0+.
23+
on .NET Core 3.1+.
2324

2425
%prep
2526
%setup -q
@@ -44,19 +45,43 @@ rm -rf %{buildroot}
4445

4546
%post
4647
NEWRELIC_HOME=/usr/local/%{name}
47-
48-
# Deprecated instrumentation files to remove post install
49-
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.Instrumentation.xml 2> /dev/null
50-
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.dll 2> /dev/null
48+
OBSOLETE_PACKAGE_NAME=newrelic-netcore20-agent
49+
OBSOLETE_NEWRELIC_HOME=/usr/local/${OBSOLETE_PACKAGE_NAME}
5150

5251
# create logs dir
5352
mkdir -p $NEWRELIC_HOME/logs 2> /dev/null
5453

55-
if [ ! -L /var/log/newrelic/dotnet ]; then
56-
mkdir -p /var/log/newrelic 2> /dev/null
57-
ln -sTf $NEWRELIC_HOME/logs /var/log/newrelic/dotnet 2> /dev/null
54+
# create symlink to logs dir in /var/log/newrelic
55+
mkdir -p /var/log/newrelic 2> /dev/null
56+
ln -sTf $NEWRELIC_HOME/logs /var/log/newrelic/dotnet 2> /dev/null
57+
58+
# remove old profile.d file if it exists
59+
oldHomeDirFile="/etc/profile.d/${OBSOLETE_PACKAGE_NAME}-path.sh"
60+
if [ -e $oldHomeDirFile ]; then
61+
echo "Cleaning up $oldHomeDirFile"
62+
rm -f $oldHomeDirFile
5863
fi
5964

65+
# migrate data from obsoleted package, if applicable
66+
if [ -d $OBSOLETE_NEWRELIC_HOME ]; then
67+
echo "Migrating user data from $OBSOLETE_NEWRELIC_HOME"
68+
69+
# migrate config file, backing up original first
70+
if [ -e $OBSOLETE_NEWRELIC_HOME/newrelic.config ]; then
71+
mv $NEWRELIC_HOME/newrelic.config $NEWRELIC_HOME/newrelic.config.original
72+
cp -v $OBSOLETE_NEWRELIC_HOME/newrelic.config $NEWRELIC_HOME/newrelic.config
73+
fi
74+
75+
# migrate any custom instrumentation
76+
if [ -d $OBSOLETE_NEWRELIC_HOME/extensions ]; then
77+
cp -nv $OBSOLETE_NEWRELIC_HOME/extensions/*.xml $NEWRELIC_HOME/extensions
78+
fi
79+
fi
80+
81+
# Deprecated instrumentation files to remove post install
82+
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.Instrumentation.xml 2> /dev/null
83+
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.dll 2> /dev/null
84+
6085
echo "export CORECLR_NEWRELIC_HOME=${NEWRELIC_HOME}" > /etc/profile.d/%{name}-path.sh
6186
source /etc/profile.d/%{name}-path.sh
6287

build/Linux/test/scripts/util.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
source /test/osht.sh
33

4-
PACKAGE_NAME='newrelic-netcore20-agent'
4+
PACKAGE_NAME='newrelic-dotnet-agent'
55

66
function print_header {
77
printf "\n\n\e[34m### $1\033[0m\n"

build/build_functions.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function Copy-AgentRoot {
150150
if ($Type -like "Core") {
151151
Copy-Item -Path "$RootDirectory\src\Agent\NewRelic\Agent\Extensions\NewRelic.Agent.Extensions\bin\$Configuration\netstandard2.0\NewRelic.Agent.Extensions.dll" -Destination "$Destination" -Force
152152
Copy-Item -Path "$RootDirectory\src\_build\AnyCPU-$Configuration\NewRelic.Agent.Core\netstandard2.0-ILRepacked\NewRelic.Agent.Core.dll" -Destination "$Destination" -Force
153-
Copy-Item -Path "$RootDirectory\src\Agent\Miscellaneous\netcore20-agent-readme.md" -Destination "$Destination\README.md" -Force
153+
Copy-Item -Path "$RootDirectory\src\Agent\Miscellaneous\core-agent-readme.md" -Destination "$Destination\README.md" -Force
154154
}
155155

156156
$grpcDir = Get-GrpcPackagePath $RootDirectory

deploy/linux/deploy_scripts/deploy-packages.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ printf \\n
188188

189189
## BEGIN MODIFY PHASE ##
190190

191-
PRODUCT_NAME='newrelic-netcore20-agent'
191+
PRODUCT_NAME='newrelic-dotnet-agent'
192192

193193
if [[ "$ACTION" == 'release' ]]; then
194194
# Find the local package files to be deployed

src/Agent/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* Adds an ignore rule to prevent profiling `SMSvcHost.exe`. ([#1182](https://github.com/newrelic/newrelic-dotnet-agent/pull/1182))
1616

1717
### Deprecations/Removed Features
18+
19+
INSERT LINK TO MIGRATION GUIDE HERE
20+
1821
* The scriptable installers have been removed. ([#1170](https://github.com/newrelic/newrelic-dotnet-agent/pull/1170))
22+
* The Linux installation packages have been renamed. ([#1180](https://github.com/newrelic/newrelic-dotnet-agent/pull/1180))
1923
* Castle.Monorail instrumentation has been removed. ([#1177])(https://github.com/newrelic/newrelic-dotnet-agent/pull/1177)
2024

2125
## [9.9.0] - 2022-06-08

tests/Agent/SmokeTest/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ RUN apt-get install -y less vim dos2unix
55

66
ENV CORECLR_ENABLE_PROFILING="1" \
77
CORECLR_PROFILER="{36032161-FFC0-4B61-B559-F6C5D41BAE5A}" \
8-
CORECLR_NEWRELIC_HOME="/usr/local/newrelic-netcore20-agent" \
9-
CORECLR_PROFILER_PATH="/usr/local/newrelic-netcore20-agent/libNewRelicProfiler.so"
8+
CORECLR_NEWRELIC_HOME="/usr/local/newrelic-dotnet-agent" \
9+
CORECLR_PROFILER_PATH="/usr/local/newrelic-dotnet-agent/libNewRelicProfiler.so"
1010

1111
COPY ./app /app
1212
COPY ./run.sh /root

tests/Agent/SmokeTest/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# constants
4-
package_name='newrelic-netcore20-agent'
4+
package_name='newrelic-dotnet-agent'
55
agent_package_dir='/agent'
66

77
local_deb_package=$(find ${agent_package_dir} -name "${package_name}*.deb" |tail -n 1)

0 commit comments

Comments
 (0)