以下の内容はhttps://dk521123.hatenablog.com/entry/2025/01/08/201947より取得しました。


【Github】Github Actions ~ Self-hosted runners / 自動更新OFF ~

◾️はじめに

https://dk521123.hatenablog.com/entry/2024/12/31/184145

で、Github action の Self-hosted runner がサービス(デーモン)で立ち上がっていて
デgフォルトだと自動更新が入り、
それによって環境によっては止まる場合があった。

そこで、今回は、自動更新の無効化する方法などについて、メモっておく。

目次

【1】おさらい:runnerの自動更新
【2】runnerの自動更新OFF
 1)使い方
 2)後日談:エラー「Runner version vX.XXX.X is deprecated ...」
【3】おまけ:自動更新により発生したトラブル

【1】おさらい:runnerの自動更新

* Self-hosted runnerは、実行中に自動アップデートされている
 => 以下のサイトでも同じことを言っている。

https://zenn.dev/snowcait/articles/33ff408b7e8985

【2】runnerの自動更新OFF

https://github.blog/changelog/2022-02-01-github-actions-self-hosted-runners-can-now-disable-automatic-updates/

の「--disableupdate」が使えそう。

https://github.com/actions/runner/blob/main/src/Runner.Listener/Runner.cs

より抜粋
〜〜〜〜〜
Config Options:
...
--disableupdate 
       Disable self-hosted runner automatic update to the latest released version
訳:セルフホスト・ランナーの最新リリース・バージョンへの自動アップデートを無効にする
〜〜〜〜〜

1)使い方

https://github.com/orgs/community/discussions/50112

# Create the runner and start the configuration experience
./config.sh --url https://github.com/your-user/your-repo ¥
--token {YOUR_TOKEN} --disableupdate

2)後日談:エラー「Runner version vX.XXX.X is deprecated ...」

* 更新しないはしないで、以下のエラーが発生する可能性もある。。。
 => 結局、更新しないとダメじゃん、、、

エラーメッセージ

An error occured: Runner version vX.XXX.X is deprecated
and cannot receive messages.

【3】おまけ:自動更新により発生したトラブル

* 原因の切り分けなどの詳細は、以下の関連記事を参照のこと。

Github Actions ~ Self-hosted runners で Offline だった場合の対応について考える ~
https://dk521123.hatenablog.com/entry/2024/12/31/184145

* journalctlログ調査により、以下がわかった。

[1] Self-hosted runnerは、実行中に自動アップデートされている
 => 以下のサイトでも同じことを言っている。

https://zenn.dev/snowcait/articles/33ff408b7e8985

[2] 現象が発生したバージョンは、
 「Current runner version: '2.231.0'」に更新されていた
 => 以下は、公式のChange log。

https://github.com/actions/runner/releases/tag/v2.321.0

によると
〜〜〜〜
Remove node16 from the runner. by @TingluoHuang in #3503
〜〜〜〜
という修正がなされており、

https://github.com/actions/runner/blob/fde5227fbfe9c61b7861cc959ebbbba62af4754b/src/Misc/layoutbin/runsvc.sh#L13C1-L13C17

をみると、Nodeのバージョンが「nodever="node20"」に固定されている。
このNodeバージョンに合わないSelf-hosted runner の環境だと
サービスが立ち上がらないかと予想。

Self-hosted runner(今回は、Amazon Linux2)の
System log(/var/log/messages)を確認したところ
以下のようなエラーになっていた。

→そこで、以下の2点を行ったところ、Actions runnerサービスが起動した。
 (原因は、更新によるもので、ほぼ間違いないかと、、、)
 1) シンボリックリンク「externals」を無理やり
  前のversion(今回の場合、「externals.2.320.0」)に変更
 2) runsvc.shの「nodever="node20"」を前バージョンに行くように修正
  (実際の修正方法は、Github のChangelog参照)

/var/log/messages

runsvc.sh: ./externals/node20/bin/node: /actions-runner/externals/node20/bin/node: /lib64/libm.so.6:
version `GLIB_2.27` not found
 (required by /actions-runner/externals/node20/bin/node)
runsvc.sh: ./externals/node20/bin/node: /actions-runner/externals/node20/bin/node: /lib64/libm.so.6:
version `GLIB_2.28` not found
 (required by /actions-runner/externals/node20/bin/node)
systemd: Unit actions.xxx.service entered failed state.
systemd: actions.xxx.service failed.

関連記事

Github Actions ~ Self-hosted runners / 入門編 ~
https://dk521123.hatenablog.com/entry/2023/12/18/204119
Github Actions ~ Self-hosted runners / あれこれ編 ~
https://dk521123.hatenablog.com/entry/2024/02/07/002736
Github Actions ~ Self-hosted runners / 設定関連 ~
https://dk521123.hatenablog.com/entry/2025/01/09/132401
Github Actions ~ Self-hosted runners で Offline だった場合の対応について考える ~
https://dk521123.hatenablog.com/entry/2024/12/31/184145
lnコマンド / update-alternativesコマンド
https://dk521123.hatenablog.com/entry/2024/02/25/233428




以上の内容はhttps://dk521123.hatenablog.com/entry/2025/01/08/201947より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14