simp config SetHostnameAction edits /etc/sysconfig/network and calls ifdown/ifup

未關閉
#234 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
重構
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
linux, ruby
領域
cli

研究方向

Start with lib/simp/cli/config/items/action/set_hostname_action.rb, lines 33-34 (sed on /etc/sysconfig/network) and line 62 (ifdown/ifup), and read #223 for the sibling ConfigureNetworkAction. The change replaces both with hostnamectl and nmcli, and the issue leaves open whether the installer still creates the file, so confirm that before editing. Done means the action no longer depends on that file or on the ifup/ifdown binaries, with the existing specs passing on EL8-EL10.

由索引模型根據 Issue 內容生成。

描述

Problem

lib/simp/cli/config/items/action/set_hostname_action.rb:

  • lines 33-34 run sed -i '/HOSTNAME/d' /etc/sysconfig/network and append HOSTNAME= to it;
  • line 62 runs /sbin/ifdown <interface>; /sbin/ifup <interface>;
  • the action is fatal on failure.

No package on EL8, EL9 or EL10 owns /etc/sysconfig/network, and it is absent from the AlmaLinux container images. ifup and ifdown come from network-scripts on EL8 and NetworkManager-initscripts-updown on EL9; nothing provides them on EL10.

Impact

Where the file is missing, sed -i fails and simp config aborts. On EL10 the interface bounce cannot run. Whether a full installer-built system still creates the file was not checked.

Proposed change

Set the hostname with hostnamectl set-hostname only, and replace ifdown/ifup with nmcli. Related: #223, which covers ConfigureNetworkAction.

🤖 Drafted by Claude.

主要語言
Ruby
星號
2
分支
12
平均合併
1 天 13 小時
30 天內合併 PR
4

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

simp/rubygem-simp-cli 的其他 Issue

查看 simp/rubygem-simp-cli 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。