Bug #6487
closedAvoid waiting on lock when calling yum
Description
Add --setopt=exit_on_lock=True to all yum calls
Updated by Nicolas CHARLES over 8 years ago
This sounds pretty interesting !
However, on which version is it available?
https://bugzilla.redhat.com/show_bug.cgi?id=861250 seems to mention that RHEL6 has it, but maybe not first versions of RHEL ...
is there a way to detect if the feature exists ?
Updated by Nicolas CHARLES over 8 years ago
- Translation missing: en.field_tag_list set to sponsored
Updated by Jonathan CLARKE over 8 years ago
Nicolas CHARLES wrote:
This sounds pretty interesting !
However, on which version is it available?
https://bugzilla.redhat.com/show_bug.cgi?id=861250 seems to mention that RHEL6 has it, but maybe not first versions of RHEL ...
is there a way to detect if the feature exists ?
According to http://illiterat.livejournal.com/8221.html the --setopt option was only introduced in RHEL 6.1's yum.
However, that option is just a wrapper to make it possible to change config values from yum.conf on the command line. So maybe we can set it via yum.conf (or a temporary yum.conf) before that version...
However, according to http://lists.baseurl.org/pipermail/yum-devel/2010-June/007087.html, it seems that the "exit_on_lock" option was only added after --setopt, so no.
But I have found a solution: yum versions without the --setopt option complain when it is used, and yum versions with it but when passed a specific option that is not in the main config, it complains too. So by running:
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)
Updated by François ARMAND over 8 years ago
- Translation missing: en.field_tag_list changed from Sponsored to Sponsored, Next minor release
Updated by Benoît PECCATTE over 8 years ago
- Related to Bug #6488: Avoid waiting on lock when calling yum added
Updated by Jonathan CLARKE over 8 years ago
Jonathan CLARKE wrote:
Nicolas CHARLES wrote:
This sounds pretty interesting !
However, on which version is it available?
https://bugzilla.redhat.com/show_bug.cgi?id=861250 seems to mention that RHEL6 has it, but maybe not first versions of RHEL ...
is there a way to detect if the feature exists ?According to http://illiterat.livejournal.com/8221.html the --setopt option was only introduced in RHEL 6.1's yum.
However, that option is just a wrapper to make it possible to change config values from yum.conf on the command line. So maybe we can set it via yum.conf (or a temporary yum.conf) before that version...
However, according to http://lists.baseurl.org/pipermail/yum-devel/2010-June/007087.html, it seems that the "exit_on_lock" option was only added after --setopt, so no.
But I have found a solution: yum versions without the --setopt option complain when it is used, and yum versions with it but when passed a specific option that is not in the main config, it complains too. So by running:
[...]
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)
Make sure to export LANG=C first so we don't have * localised error messages
Updated by Nicolas CHARLES over 8 years ago
- Status changed from New to In progress
Updated by Nicolas CHARLES over 8 years ago
- Status changed from In progress to Pending technical review
- Assignee changed from Nicolas CHARLES to Benoît PECCATTE
- Pull Request set to https://github.com/Normation/rudder-techniques/pull/939
Updated by Nicolas CHARLES over 8 years ago
- Status changed from Pending technical review to Pending release
- % Done changed from 0 to 100
Applied in changeset rudder-techniques|0544d6f0a4df3f6d93e79a160ddaadfc290935aa.
Updated by Nicolas CHARLES over 8 years ago
- Related to Bug #8376: Error messages about setopt in the inform output of the agent added
Updated by Nicolas CHARLES over 8 years ago
- Related to Bug #8377: Error messages about setopt in the inform output of the agent added
Updated by Jonathan CLARKE over 8 years ago
- Related to deleted (Bug #8376: Error messages about setopt in the inform output of the agent)
Updated by Vincent MEMBRÉ over 8 years ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 2.11.21, 3.0.16, 3.1.10 and 3.2.3 which were released on 2016-06-01, but not announced.
- 2.11: Changelog
- 3.0: Changelog
- 3.1: Changelog
- 3.2: Changelog
- Download: https://www.rudder-project.org/site/get-rudder/downloads/
Updated by Alexis Mousset almost 6 years ago
- Related to Bug #14235: Avoid checking for exit_on_lock option on newer yum added