Project

General

Profile

Actions

Bug #6487

closed

Avoid waiting on lock when calling yum

Bug #6487: Avoid waiting on lock when calling yum

Added by Benoît PECCATTE over 11 years ago. Updated about 4 years ago.

Status:
Released
Priority:
N/A
Category:
Techniques
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
Fix check:
Regression:

Description

Add --setopt=exit_on_lock=True to all yum calls


Subtasks 1 (0 open1 closed)

Bug #8376: Error messages about setopt in the inform output of the agentReleasedJonathan CLARKEActions

Related issues 3 (0 open3 closed)

Related to Rudder - Bug #6488: Avoid waiting on lock when calling yumReleasedBenoît PECCATTEActions
Related to Rudder - Bug #8377: Error messages about setopt in the inform output of the agentReleasedJonathan CLARKEActions
Related to Rudder - Bug #14235: Avoid checking for exit_on_lock option on newer yumReleasedNicolas CHARLESActions

Updated by Nicolas CHARLES over 10 years ago Actions #1

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 10 years ago Actions #2

  • Translation missing: en.field_tag_list set to sponsored

Updated by Jonathan CLARKE over 10 years ago Actions #3

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 about 10 years ago Actions #4

  • Translation missing: en.field_tag_list changed from Sponsored to Sponsored, Next minor release

Updated by Benoît PECCATTE about 10 years ago Actions #5

  • Related to Bug #6488: Avoid waiting on lock when calling yum added

Updated by Benoît PECCATTE about 10 years ago Actions #6

  • Target version set to 2.11.21

Updated by Jonathan CLARKE about 10 years ago Actions #7

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 about 10 years ago Actions #8

  • Assignee set to Nicolas CHARLES

Updated by Nicolas CHARLES about 10 years ago Actions #9

  • Status changed from New to In progress

Updated by Nicolas CHARLES about 10 years ago Actions #10

  • 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 about 10 years ago Actions #11

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100

Updated by Nicolas CHARLES about 10 years ago Actions #12

  • Related to Bug #8376: Error messages about setopt in the inform output of the agent added

Updated by Nicolas CHARLES about 10 years ago Actions #13

  • Related to Bug #8377: Error messages about setopt in the inform output of the agent added

Updated by Jonathan CLARKE about 10 years ago Actions #14

  • Related to deleted (Bug #8376: Error messages about setopt in the inform output of the agent)

Updated by Vincent MEMBRÉ about 10 years ago Actions #15

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

Updated by Alexis Mousset over 7 years ago Actions #16

  • Related to Bug #14235: Avoid checking for exit_on_lock option on newer yum added

Updated by Alexis Mousset about 4 years ago Actions #17

  • Priority set to 0
Actions

Also available in: PDF Atom