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 摘要。