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

Aperta
#234 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
linux, ruby
Ambito
cli

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Ruby
Stelle
2
Fork
12
Merge medio
1g 13h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di simp/rubygem-simp-cli

Tutte le issue di simp/rubygem-simp-cli

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.