[SERVER-46342] DEB installs of MDB do not issue systemctl daemon-reload on install Created: 14/Feb/20  Updated: 29/Oct/23  Resolved: 02/Mar/20

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: None
Fix Version/s: 4.3.4, 4.2.11, 4.0.21, 3.6.21

Type: Bug Priority: Major - P3
Reporter: Andrew Feierabend (Inactive) Assignee: Mathew Robinson (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: HTML File DEB Error on Ubuntu18     HTML File DEB vs RPM    
Issue Links:
Backports
Problem/Incident
causes SERVER-52937 mongodb-org 4.2.11 debian package is ... Closed
Related
related to SERVER-52806 deb install files assume systemd Closed
related to SERVER-50888 Consider SERVER-46342 for backport to... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.4, v4.2, v4.0, v3.6
Sprint: Dev Platform 2020-03-09
Participants:
Linked BF Score: 41

 Description   

In testing, DEB installs of latest MDB v4.2.3 run into the following error if MDB had been previously installed and then uninstalled on the machine:

Failed to start mongod.service: Unit mongod.service not found.

 

The fix is to manually run: 

sudo systemctl daemon-reload

 

We've gotten some light feedback on the docs concerning this, so I went and tested this:

Findings:

  • I was able to verify this on Ubuntu 18 and Debian 10, and have attached steps to reproduce (for Ubuntu 18).
  • I believe the DEB install script just needs to add the systemctl daemon-reload command post-install. It would appear that our RPMs do perform this step post-install. I've attached a comparison. Sure enough, in testing RPMs on CentOS 8 and 7, this problem does not occur (i.e. install, uninstall, reinstall does not require explicitly running daemon-reload on RPM distros)
  • Interestingly, the DEB uninstall script (postrm) does run the systemctl daemon-reload command. Ironically, it might be its very inclusion in the uninstall step that causes this issue in the first place, since it forces systemd to realize that the mongod.service file has been removed.
  • This probably affects any DEB-using distro that uses systemd until files, even those on which users might be running SysV Init commands (i.e. service) instead of systemctl, as those distros redirect those commands to systemd in the background. A tweak to the DEB install steps to include daemon-reload would fix these distros too, but should be done in a way that it fails silently on non-systemd machines. The RPM seems to handle this well, and might be a good source for comparison.

Hope this helps!



 Comments   
Comment by Githook User [ 09/Dec/20 ]

Author:

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

Message: SERVER-46342 Reload systemd service file on install for deb platforms

This reverts commit 1cd2db51dce4b16f4bc97a75056269df0dc0bddb.
Branch: v3.6
https://github.com/mongodb/mongo/commit/23ffc06d3ddf7c80ebe73a544ca09218225a8627

Comment by Githook User [ 08/Dec/20 ]

Author:

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

Message: SERVER-46342 Reload systemd service file on install for deb platforms

This reverts commit 0ed9f1bf7d27e43174ce806291a597947b1f98ae.
Branch: v4.0
https://github.com/mongodb/mongo/commit/7feae2d6b3d8307a8ea47ea17764d827811e7c69

Comment by Githook User [ 12/Nov/20 ]

Author:

{'name': 'Zakhar Kleyman', 'email': 'zakhar.kleyman@mongodb.com', 'username': 'zakhark'}

Message: Revert "SERVER-46342 Reload systemd service file on install for deb platforms"

This reverts commit 08e22cf1dbc7f28db4ff0711b2feb166d776c2d8.
Branch: v4.0
https://github.com/mongodb/mongo/commit/0ed9f1bf7d27e43174ce806291a597947b1f98ae

Comment by Githook User [ 11/Nov/20 ]

Author:

{'name': 'Zakhar Kleyman', 'email': 'zakhar.kleyman@mongodb.com', 'username': 'zakhark'}

Message: Revert "SERVER-46342 Reload systemd service file on install for deb platforms"

This reverts commit d30e67386b75d724f324246a8dae34065ee8250f.
Branch: v3.6
https://github.com/mongodb/mongo/commit/1cd2db51dce4b16f4bc97a75056269df0dc0bddb

Comment by Githook User [ 15/Oct/20 ]

Author:

{'name': 'Mathew Robinson', 'email': 'mathew@chasinglogic.io', 'username': 'chasinglogic'}

Message: SERVER-46342 Reload systemd service file on install for deb platforms

(cherry picked from commit 0690089e24d1ae398b3cafc348a0b9c9f5f24527)
Branch: v4.2
https://github.com/mongodb/mongo/commit/e1363299a93f53ebbff4a24f11e5d132e25a5c40

Comment by Githook User [ 15/Oct/20 ]

Author:

{'name': 'Mathew Robinson', 'email': 'mathew@chasinglogic.io', 'username': 'chasinglogic'}

Message: SERVER-46342 Reload systemd service file on install for deb platforms

(cherry picked from commit 0690089e24d1ae398b3cafc348a0b9c9f5f24527)
Branch: v4.0
https://github.com/mongodb/mongo/commit/08e22cf1dbc7f28db4ff0711b2feb166d776c2d8

Comment by Githook User [ 15/Oct/20 ]

Author:

{'name': 'Mathew Robinson', 'email': 'mathew@chasinglogic.io', 'username': 'chasinglogic'}

Message: SERVER-46342 Reload systemd service file on install for deb platforms

(cherry picked from commit 0690089e24d1ae398b3cafc348a0b9c9f5f24527)
Branch: v3.6
https://github.com/mongodb/mongo/commit/d30e67386b75d724f324246a8dae34065ee8250f

Comment by Githook User [ 28/Feb/20 ]

Author:

{'username': 'chasinglogic', 'name': 'Mathew Robinson', 'email': 'mathew@chasinglogic.io'}

Message: SERVER-46342 Reload systemd service file on install for deb platforms
Branch: master
https://github.com/mongodb/mongo/commit/0690089e24d1ae398b3cafc348a0b9c9f5f24527

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