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:
The fix is to manually run:
We've gotten some light feedback on the docs concerning this, so I went and tested this:
- 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!