Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-46342

DEB installs of MDB do not issue systemctl daemon-reload on install

    • Fully Compatible
    • v4.4, v4.2, v4.0, v3.6
    • Dev Platform 2020-03-09
    • 41

      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:


      • 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!

        1. DEB vs RPM
          3 kB
        2. DEB Error on Ubuntu18
          9 kB

            mathew.robinson@mongodb.com Mathew Robinson (Inactive)
            andrew.feierabend@mongodb.com Andrew Feierabend (Inactive)
            0 Vote for this issue
            2 Start watching this issue