Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2759

Make package promises yum exit on lock

    XMLWordPrintable

    Details

      Description

      If you use promises to update package, and update agent, it can lead to a deadlock using Yum, as promises using yum will use yum to update agent, and wait for it to finish.

      There's an option --setopt=exit_on_lock=True that prevents deadlock, and allow for correct lock management on yum

      According to https://bugzilla.redhat.com/show_bug.cgi?id=861250 the first version of yum on redhat 6 included the --setopt=exit_on_lock=True option.

      According to https://www.rudder-project.org/redmine/issues/6487

      According to http://illiterat.livejournal.com/8221.html the --setopt option was only introduced in RHEL 6.1's yum.

      yum --setopt=exit_on_lock=True 2>&1 | grep -E "(Command line error: no such option: --setopt|Main config did not have a exit_on_lock attr. before setopt)

      If the command returns 0, that means the option is not supported.

      Note: this works even if yum's lock is already obtained, because there is no yum command (so the first command will return 1, and not even try to take the lock)

       https://github.com/Normation/ncf/pull/680

      Note: Some people backport to el5 so in this change we dont skip el5 unless the option isnt found.

        Attachments

          Activity

            People

            • Assignee:
              a10042 Nick Anderson
              Reporter:
              ncharles Nicolas Charles
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel