[SERVER-52610] Verify installation prefix is added to correct location in the RPM Created: 03/Nov/20  Updated: 29/Oct/23  Resolved: 19/Dec/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0, 4.4.5, 4.2.14, 4.0.25

Type: Improvement Priority: Major - P3
Reporter: April Schoffer Assignee: Ryan Egesdahl (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Documented
is documented by DOCS-14065 Investigate changes in SERVER-52610: ... Closed
Problem/Incident
Related
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.4, v4.2, v4.0
Sprint: Dev Platform 2020-11-16, Dev Platform 2020-11-30, Dev Platform 2020-12-14, Dev Platform 2020-12-28
Participants:
Linked BF Score: 84

 Description   

Currently, users installing multiple versions of MongDB via RPM package on the same server using "--prefix <p>" still results in files being deployed to common locations.

Adding the installation prefix to the right parts of the RPM should be a fairly mechanical fix to address this.



 Comments   
Comment by Githook User [ 12/May/21 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-52610 Ensure RPM install roots can be relocated

We were not using directory macros in the RPMs, which meant that the
installation root could not be changed. When we tried, we got an
incomplete install, with some of it going to the new prefix and some
going to the host system. Here, we follow RPM packaging guidelines a bit
better and use named directory macros instead of explicit paths.

(cherry picked from commit 9aba0cac770d87d36cf0f0d19a1be06e73312221)
(cherry picked from commit 6670cb159540b07b8a39fe4c072c24ff7a0130f0)
(cherry picked from commit 2495a8fa87c215da70c3361beef11d52ce5be1c0)
Branch: v4.0
https://github.com/mongodb/mongo/commit/7f36eb67d3403faf554a6241f1ec1a3890eaf01f

Comment by Githook User [ 12/May/21 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: Revert "SERVER-52610 Ensure RPM install roots can be relocated"

This reverts commit 51304bb545840ef0b62a6445b1060559ab831ea1.
Branch: v4.0
https://github.com/mongodb/mongo/commit/e5f2354bb3cab56404c1347fc9f4ea4173838b0f

Comment by Githook User [ 07/May/21 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-52610 Ensure RPM install roots can be relocated

We were not using directory macros in the RPMs, which meant that the
installation root could not be changed. When we tried, we got an
incomplete install, with some of it going to the new prefix and some
going to the host system. Here, we follow RPM packaging guidelines a bit
better and use named directory macros instead of explicit paths.

(cherry picked from commit 9aba0cac770d87d36cf0f0d19a1be06e73312221)
(cherry picked from commit 6670cb159540b07b8a39fe4c072c24ff7a0130f0)
(cherry picked from commit 2495a8fa87c215da70c3361beef11d52ce5be1c0)
Branch: v4.0
https://github.com/mongodb/mongo/commit/51304bb545840ef0b62a6445b1060559ab831ea1

Comment by Githook User [ 05/Mar/21 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-52610 Ensure RPM install roots can be relocated

We were not using directory macros in the RPMs, which meant that the
installation root could not be changed. When we tried, we got an
incomplete install, with some of it going to the new prefix and some
going to the host system. Here, we follow RPM packaging guidelines a bit
better and use named directory macros instead of explicit paths.

(cherry picked from commit 9aba0cac770d87d36cf0f0d19a1be06e73312221)
(cherry picked from commit 6670cb159540b07b8a39fe4c072c24ff7a0130f0)
Branch: v4.2
https://github.com/mongodb/mongo/commit/2495a8fa87c215da70c3361beef11d52ce5be1c0

Comment by Githook User [ 05/Mar/21 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-52610 Ensure RPM install roots can be relocated

We were not using directory macros in the RPMs, which meant that the
installation root could not be changed. When we tried, we got an
incomplete install, with some of it going to the new prefix and some
going to the host system. Here, we follow RPM packaging guidelines a bit
better and use named directory macros instead of explicit paths.

(cherry picked from commit 9aba0cac770d87d36cf0f0d19a1be06e73312221)
Branch: v4.4
https://github.com/mongodb/mongo/commit/6670cb159540b07b8a39fe4c072c24ff7a0130f0

Comment by Ryan Egesdahl (Inactive) [ 19/Dec/20 ]

With this change, you should now be able to use the --relocate argument with rpm to install the server into another root. This does not affect Compass installations, nor does it affect mongodb-tools, which is handled by another repository. An example command line to install into opt looks like this:

rpm --relocate /usr=/opt --relocate /var=/opt/var --relocate /etc=/opt/etc --noscripts mongodb-enterprise-server.rpm

Alternatively, you may be able to use yum --installroot=/opt if you are installing into a chroot environment (such as a container root directory).

Keep in mind, the default configuration installed will not work, nor will the server auto-start on boot. It's up to you to set all of that up, and you're definitely in "experienced administrator doing custom things" territory if you choose to do all of this. We're also not able to effectively test this change at this time, either, for the aforementioned reasons. It should go without saying that this is not a recommended procedure by any means unless you really know what you are doing and why you're doing it.

Comment by Githook User [ 19/Dec/20 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-52610 Ensure RPM install roots can be relocated

We were not using directory macros in the RPMs, which meant that the
installation root could not be changed. When we tried, we got an
incomplete install, with some of it going to the new prefix and some
going to the host system. Here, we follow RPM packaging guidelines a bit
better and use named directory macros instead of explicit paths.
Branch: master
https://github.com/mongodb/mongo/commit/9aba0cac770d87d36cf0f0d19a1be06e73312221

Generated at Thu Feb 08 05:28:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.