Project

General

Profile

Actions

Bug #6487

closed

Avoid waiting on lock when calling yum

Added by Benoît PECCATTE over 9 years ago. Updated over 2 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 CLARKE2016-05-25Actions

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
Actions #1

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 ?

Actions #2

Updated by Nicolas CHARLES over 8 years ago

  • Translation missing: en.field_tag_list set to sponsored
Actions #3

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)

Actions #4

Updated by François ARMAND over 8 years ago

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

Updated by Benoît PECCATTE over 8 years ago

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

Updated by Benoît PECCATTE over 8 years ago

  • Target version set to 2.11.21
Actions #7

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

Actions #8

Updated by Nicolas CHARLES over 8 years ago

  • Assignee set to Nicolas CHARLES
Actions #9

Updated by Nicolas CHARLES over 8 years ago

  • Status changed from New to In progress
Actions #10

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
Actions #11

Updated by Nicolas CHARLES over 8 years ago

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

Updated by Nicolas CHARLES over 8 years ago

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

Updated by Nicolas CHARLES over 8 years ago

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

Updated by Jonathan CLARKE over 8 years ago

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

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.

Actions #16

Updated by Alexis Mousset almost 6 years ago

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

Updated by Alexis Mousset over 2 years ago

  • Priority set to 0
Actions

Also available in: Atom PDF