Details
-
Type:
Bug
-
Status: Done
-
Priority:
Medium
-
Resolution: Fixed
-
Affects Version/s: 3.10.2
-
Component/s: Masterfiles Policy Framework (MPF/COPBL/STDLIB)
-
Labels:None
-
Environment:redhat like
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.