Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-2605

Debian packages should be idempotent

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0, 2.6.3
    • Fix Version/s: None
    • Component/s: packaging
    • Labels:
    • Environment:
      Ubuntu 14 or Ubuntu 15
    • Support Ticket IDs:

      Description

      Package installation seems fragile, due to our preinst and postinst scripts. The first install from clean is OK:

      cjr@ubuntu:~/Desktop$ sudo dpkg -i opendj_3.0.0-1.20160108-1706_all.deb 
      Selecting previously unselected package opendj.
      (Reading database ... 221969 files and directories currently installed.)
      Preparing to unpack opendj_3.0.0-1.20160108-1706_all.deb ...
      
      Unpacking opendj (3.0.0) ...
      Setting up opendj (3.0.0) ...
      
      Processing triggers for systemd (225-1ubuntu9) ...
      Processing triggers for ureadahead (0.100.0-19) ...
      

      The second install fails:

      cjr@ubuntu:~/Desktop$ sudo dpkg -i opendj_3.0.0-1.20160108-1706_all.deb 
      (Reading database ... 222355 files and directories currently installed.)
      Preparing to unpack opendj_3.0.0-1.20160108-1706_all.deb ...
      Instance is not configured. Upgrade aborded.
      dpkg: error processing archive opendj_3.0.0-1.20160108-1706_all.deb (--install):
       subprocess new pre-installation script returned error exit status 255
      
      
      Errors were encountered while processing:
       opendj_3.0.0-1.20160108-1706_all.deb
      

      Debian requires installation to be idempotent, and we clearly are not. See section 6.2:

      https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html

      To clean up properly, you need to do a purge:

      sudo dpkg -P opendj
      sudo rm -fr /opt/opendj
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cjr Chris Ridd
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: