Skip to content

Commit

Permalink
alternatives: update doc to use the usual alternatives commands
Browse files Browse the repository at this point in the history
  • Loading branch information
HuijingHei committed Oct 24, 2024
1 parent 27968e3 commit d846fad
Showing 1 changed file with 15 additions and 31 deletions.
46 changes: 15 additions & 31 deletions modules/ROOT/pages/alternatives.adoc
Original file line number Diff line number Diff line change
@@ -1,37 +1,21 @@
= Setting alternatives

Due to an https://github.com/fedora-sysv/chkconfig/issues/9[ongoing issue] in how alternatives configurations are stored on the system, Fedora CoreOS systems can not use the usual `alternatives` commands to configure them.
Now Fedora CoreOS systems can use the usual `alternatives` commands to configure the default command, as https://github.com/fedora-sysv/chkconfig/issues/9[issue] is fixed.

Instead, until this issue is resolved, you can set the symlinks directly in `/etc/alternatives`. For example, to use the legacy-based variants of the `iptables` commands:
For example, to use the legacy-based variants of the `iptables` commands:

[source,yaml,subs="attributes"]
[source,bash,subs="attributes"]
----
variant: fcos
version: {butane-latest-stable-spec}
storage:
links:
- path: /etc/alternatives/iptables
target: /usr/sbin/iptables-legacy
overwrite: true
hard: false
- path: /etc/alternatives/iptables-restore
target: /usr/sbin/iptables-legacy-restore
overwrite: true
hard: false
- path: /etc/alternatives/iptables-save
target: /usr/sbin/iptables-legacy-save
overwrite: true
hard: false
- path: /etc/alternatives/ip6tables
target: /usr/sbin/ip6tables-legacy
overwrite: true
hard: false
- path: /etc/alternatives/ip6tables-restore
target: /usr/sbin/ip6tables-legacy-restore
overwrite: true
hard: false
- path: /etc/alternatives/ip6tables-save
target: /usr/sbin/ip6tables-legacy-save
overwrite: true
hard: false
# The legacy priority is 10, update nft to lower priority, so legacy wins
pfx=/usr/sbin/iptables
pfx6=/usr/sbin/ip6tables
sudo alternatives --install ${pfx} iptables ${pfx}-nft 5 \
--slave ${pfx6} ip6tables ${pfx6}-nft \
--slave ${pfx}-restore iptables-restore ${pfx}-nft-restore \
--slave ${pfx}-save iptables-save ${pfx}-nft-save \
--slave ${pfx6}-restore ip6tables-restore ${pfx6}-nft-restore \
--slave ${pfx6}-save ip6tables-save ${pfx6}-nft-save
sudo alternatives --auto iptables
iptables --version
----

0 comments on commit d846fad

Please sign in to comment.