1---2name: centos-linux-triage-33description: Diagnose and remediate CentOS Linux incidents with RHEL-compatible systemd, journal, dnf/yum, SELinux, firewalld, and rollback practices. Use when the user asks to triage CentOS service failures, package issues, boot problems, networking/firewall symptoms, or security-policy denials.4---56<!-- Generated from harness/github-copilot/plugins/linux-operations/skills/centos-linux-triage/SKILL.md by harness/claude-code/scripts/convert_from_copilot.py. Edit the source, not this file. -->78# CentOS Linux triage910Diagnose a CentOS problem report, transform release and constraint details into a safe RHEL-compatible triage plan, and return copy-paste-ready remediation, validation, and rollback commands.1112## When to invoke1314- "Triage this CentOS service failure."15- "Fix a CentOS package or dnf/yum issue."16- "Why is this CentOS host blocked by SELinux or firewalld?"17- "Give me CentOS remediation commands with rollback."18- "Debug this CentOS Stream or legacy CentOS problem."1920## Request facts to capture2122Preserve these original inputs when they are supplied by the caller: `${input:CentOSVersion}`, `${input:ProblemSummary}`, and `${input:Constraints}`. If any are absent, infer only safe defaults and mark unknowns explicitly.2324| Fact | How to collect | Why it matters |25| --- | --- | --- |26| Release line | `cat /etc/centos-release`, `cat /etc/os-release`, `rpm -E %rhel` | CentOS Stream, CentOS Linux 7, and RHEL-compatible rebuilds differ in package sources and support posture. |27| Runtime context | `systemd-detect-virt`, `hostnamectl`, `uname -r` | Containers, VMs, and bare metal expose different service, kernel, and boot behavior. |28| Failing unit | `systemctl status <unit> --no-pager`, `systemctl is-enabled <unit>` | Separates disabled, failed, masked, missing, and dependency-blocked units. |29| Recent changes | `dnf history info last` or `yum history info last`, `rpm -qa --last | head` | Package updates and removals are common root causes. |30| Constraints | maintenance window, no reboot, no package install, production host | Determines whether to restart, reboot, downgrade, or only gather evidence. |3132## Triage command map3334| Symptom | First commands | Evidence to read |35| --- | --- | --- |36| Service failed | `systemctl status <unit> --no-pager`; `journalctl -u <unit> -b --no-pager` | Exit code, failed dependency, denied path, missing config, port conflict. |37| Boot or kernel issue | `journalctl -b -p warning --no-pager`; `grubby --default-kernel`; `uname -r` | Kernel mismatch, initramfs failure, failed mount, emergency target cause. |38| Package conflict | `dnf check`; `dnf repolist`; `dnf history list`; use `yum` on legacy hosts | Broken dependencies, disabled repos, modular stream conflicts, incomplete transactions. |39| Disk pressure | `df -h`; `du -xh /var | sort -h | tail`; `journalctl --disk-usage` | Full `/`, `/var`, logs, cache, or application data. |40| Network path | `ip addr`; `ip route`; `ss -tulpn`; `resolvectl status` or `/etc/resolv.conf` | Addressing, routing, DNS, listener, local firewall. |41| SELinux denial | `getenforce`; `ausearch -m AVC,USER_AVC -ts recent`; `sealert -a /var/log/audit/audit.log` | Whether denial is real, recent, and tied to the failing service. |42| firewalld block | `firewall-cmd --state`; `firewall-cmd --list-all`; `firewall-cmd --get-active-zones` | Active zone, allowed service/port, runtime versus permanent mismatch. |4344## Remediation patterns4546| Problem | Preferred fix | Avoid |47| --- | --- | --- |48| Failed service after config edit | Validate config with the daemon-specific checker, then `systemctl restart <unit>` and `systemctl status <unit> --no-pager`. | Blind restart loops without reading `journalctl`. |49| Missing package | `dnf install <package>` or `yum install <package>` after checking enabled repos. | Curl-piping random RPM installers on production hosts. |50| Broken transaction | `dnf history undo <ID>` when safe, or `dnf distro-sync` for repository drift. | Deleting RPM database files. |51| SELinux denial | Restore labels with `restorecon -Rv <path>`, set documented booleans with `setsebool -P <boolean> on`, or create a narrow policy module only after review. | `setenforce 0` as a permanent fix. |52| firewalld port missing | `firewall-cmd --add-service=<service>` for runtime test, then `--permanent` and `--reload` after validation. | Editing iptables rules behind firewalld. |53| Log growth | `journalctl --vacuum-time=7d` or service-specific retention settings. | Removing live log files without restarting/reopening the writer. |5455## Safety rules5657- Verify every destructive command with a read-only command first: check before changing packages, firewall, SELinux policy, filesystems, or boot entries.58- Prefer reversible changes: runtime `firewall-cmd` before `--permanent`, config backups before edits, `dnf history undo` for package rollback.59- Include a no-reboot path when constraints prohibit reboot, but state when kernel, glibc, or SELinux policy changes require one for full validation.60- Use `dnf` for CentOS Stream and modern CentOS; use `yum` where the host is legacy and `dnf` is unavailable.6162## Output template6364````markdown65## CentOS triage result6667**Status:** diagnosed | remediated | blocked68**Host/release:** `<CentOS release or unknown>`69**Problem:** `<ProblemSummary>`70**Constraints:** `<Constraints or none stated>`7172### Summary73<one-paragraph diagnosis and risk statement>7475### Triage Steps761. `<read-only command>` — <evidence expected>772. `<read-only command>` — <evidence expected>7879### Remediation Commands80```bash81# backup or precheck82<command>83# change84<command>85```8687### Validation88```bash89<command proving the fix>90```9192### Rollback/Cleanup93- **Rollback/Cleanup**94```bash95<command to undo or clean up>96```97````9899## Quality gate100101- [ ] `${input:CentOSVersion}`, `${input:ProblemSummary}`, and `${input:Constraints}` were used or marked unknown.102- [ ] Release and environment assumptions were confirmed before remediation.103- [ ] Triage used `systemctl`, `journalctl`, `dnf`/`yum`, and relevant logs where applicable.104- [ ] SELinux and `firewalld` were considered when symptoms involve access, ports, or policy.105- [ ] Every major change includes validation and rollback or cleanup commands.106- [ ] Commands are copy-paste-ready and avoid destructive action without a precheck.