Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

apt-get calls don't set DPkg::Lock::Timeout, fail immediately on dpkg lock contention

オープン 初心者向け
#449 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
shell
領域
devops

調査の方向性

インストールスクリプト内のすべての apt-get 呼び出しを確認し、L1533-L1560 の APT_DEPS 再試行ループも含めます。既存の Acquire::Retries の動作を維持しながら、提案された DPkg::Lock::Timeout オプションを一貫して追加します。apt-get が dpkg ロックの競合時に直ちに失敗せず待機すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Title

apt-get calls don't set DPkg::Lock::Timeout, fail immediately on dpkg lock contention

Description

None of the script's apt-get calls set DPkg::Lock::Timeout, so any of them fail immediately if another process holds the dpkg lock (e.g. cloud-init running a concurrent apt-get on first boot):

Installing package(s): datadog-agent datadog-signing-keys
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2332 (apt-get)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
ERROR
Failed to install one or more packages...

Acquire::Retries, used on the install calls, only retries failed downloads, not lock acquisition. apt has a built-in flag for this: -o DPkg::Lock::Timeout=<seconds> makes apt poll for the lock instead of failing immediately.

Suggested fix

Add -o DPkg::Lock::Timeout='<n>' to every apt-get call in the script.

Potential Improvement

If/when support for earlier versions of apt is dropped, the APT_DEPS retry loop (L1533-1560) could be removed in favor of DPkg::Lock::Timeout, which is silently ignored on older apt:

$sudo_cmd apt-get update -o DPkg::Lock::Timeout="60"
$sudo_cmd DEBIAN_FRONTEND=noninteractive apt-get install -o Acquire::Retries="5" -o DPkg::Lock::Timeout="60" -y "${APT_DEPS[@]}"
主要言語
Shell
スター
17
フォーク
14
平均マージ
2日 22時間
マージ済み PR(30日)
7

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DataDog/agent-linux-install-script のほかの issue

DataDog/agent-linux-install-script の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。