feature request: atomic writes to (binary) files

オープン
#233 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go

調査の方向性

まず、--root / での Chisel による bash_bins のパッケージ抽出を追跡し、参照されている dpkg の動作と比較してください。完了の条件は、実行中の /usr/bin/bash を一時ファイルと移動によって ETXTBSY エラーなしで安全に置き換えられることです。

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

説明

When chisel is called by a bash instance and installs bash_bins into --root /, it will encounter an ETXTBSY error: error: cannot extract from package "bash": open /usr/bin/bash: text file busy. This is because Chisel tries to open the running /usr/bin/bash file, which triggers this error.

We want Chisel to be able to handle such cases, just like how dpkg is handling rewriting the /usr/bin/bash binary file by writing to a temporary file, and move this temporary file to overwrite the previous one, such that we can safely overwrite the running binary files.

References:

  1. https://github.com/guillemj/dpkg/blob/0fa25abf11871c75de58e14743810609518e647e/src/main/unpack.c#L1471
  2. Log from inotifywait on dpkg -i bash:
/proc/942119/root/usr/bin/ MOVED_FROM bash.dpkg-new
/proc/942119/root/usr/bin/ MOVED_TO bash
主要言語
Go
スター
434
フォーク
74
平均マージ
1日 30分
マージ済み PR(30日)
1

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

canonical/chisel のほかの issue

canonical/chisel の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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