summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Egesdahl <ryan.egesdahl@mongodb.com>2023-02-10 00:33:44 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-10 03:10:51 +0000
commit1e5c67d6b9c80eda789fece2e1973a7f7c6cb7b0 (patch)
tree1cbeeaca6078c642ba8de759fafc1ec90126c1b9
parenta6babc2a1789fae2eb6057152fca59b3da2ab778 (diff)
downloadmongo-1e5c67d6b9c80eda789fece2e1973a7f7c6cb7b0.tar.gz
SERVER-38232 Add RuntimeDirectory to mongod.service
-rw-r--r--buildscripts/package_test_internal.py4
-rw-r--r--debian/mongod.service1
2 files changed, 5 insertions, 0 deletions
diff --git a/buildscripts/package_test_internal.py b/buildscripts/package_test_internal.py
index d1f5719ffa9..8284374fc13 100644
--- a/buildscripts/package_test_internal.py
+++ b/buildscripts/package_test_internal.py
@@ -261,6 +261,9 @@ def setup(test_args: TestArgs):
# (non-forking) services and confuse the systemd emulator script.
run_and_log("sed -Ei '/^PIDFile=|PermissionsStartOnly=|Type=/d' {}/mongod.service".format(
test_args["systemd_units_dir"]))
+ # Ensure RuntimeDirectory has been added to the systemd unit file.
+ run_and_log("sed -Ei '/^ExecStart=.*/a RuntimeDirectory=mongodb' {}/mongod.service".format(
+ test_args["systemd_units_dir"]))
# Remove the journal: line (and the next) from mongod.conf, which is a
# removed configuration. The Debian version of the config never got updated.
run_and_log("sed -i '/journal:/,+1d' /etc/mongod.conf")
@@ -323,6 +326,7 @@ def test_install_is_complete(test_args: TestArgs):
] # type: List[pathlib.Path]
required_dirs = [
+ pathlib.Path('/run/mongodb'),
pathlib.Path(test_args['mongo_work_dir']),
] # type: List[pathlib.Path]
diff --git a/debian/mongod.service b/debian/mongod.service
index 23ee30b4a9e..12283a12ef5 100644
--- a/debian/mongod.service
+++ b/debian/mongod.service
@@ -9,6 +9,7 @@ User=mongodb
Group=mongodb
EnvironmentFile=-/etc/default/mongod
ExecStart=/usr/bin/mongod --config /etc/mongod.conf
+RuntimeDirectory=mongodb
# file size
LimitFSIZE=infinity
# cpu time