ยง2023-09-14
- etc-update
- This tool will interactively guide you through the process of merging changes. It will present the changes side by side and allow you to choose which ones to keep or discard.
- dispatch-conf:
- This tool is similar to etc-update but has a slightly different interface. It also allows you to interactively manage configuration file updates.
$ sudo cp -v /etc/dhcpcd.conf /etc/dhcpcd.conf.old
$ sudo /usr/sbin/etc-update
Scanning Configuration files...
The following is the list of files which need updating, each
configuration file is followed by a list of possible replacement files.
1) /etc/dhcpcd.conf (1)
Please select a file to edit by entering the corresponding number.
(don't use -3, -5, -7 or -9 if you're unsure what to do)
(-1 to exit) (-3 to auto merge all files)
(-5 to auto-merge AND not use 'mv -i')
(-7 to discard all updates)
(-9 to discard all updates AND not use 'rm -i'): -5
Replacing /etc/dhcpcd.conf with /etc/._cfg0000_dhcpcd.conf
Exiting: Nothing left to do; exiting. :)
$ diff /etc/dhcpcd.conf /etc/dhcpcd.conf.old
48a49,50
> # Don't attempt to obtain an IPv4LL address if we failed to get one via DHCP. See RFC 3927.
> noipv4ll
$ sudo /usr/sbin/etc-update Scanning Configuration files... Exiting: Nothing left to do; exiting. :)
When you run etc-update in Gentoo, it lists configuration files that need updating and provides options for how to handle each file. In your case, you have one file that needs updating: /etc/dhcpcd.conf. Here's what each option means:
- /etc/dhcpcd.conf (1): This is the configuration file that needs updating. You have several options to choose from:
-1 to exit: This option allows you to exit etc-update without making any changes. If you're unsure about how to proceed or want to review the changes later, you can exit and come back to it later.
-3 to auto-merge all files: This option automatically attempts to merge the changes from the new configuration file into your existing one. If there are no conflicts, it will perform the merge without asking for your input. However, if there are conflicts, it will stop and ask for your input.
-5 to auto-merge AND not use 'mv -i': This option is similar to -3, but it won't use mv -i to move the new file into place. It's generally safer to use -5 if you're unsure.
-7 to discard all updates: This option discards all updates, meaning it won't apply the changes from the new configuration file. This is useful if you want to keep your existing configuration as-is.
-9 to discard all updates AND not use 'rm -i': Similar to -7, but it also skips the interactive confirmation for removing the old configuration file. Use this if you're confident you want to discard the updates.
In your case, if you're unsure about the changes in /etc/dhcpcd.conf, you might want to choose either -1 to exit and manually review the changes later or -3 to auto-merge the files and deal with conflicts if they arise. If you're cautious, you can use -5 to auto-merge without the interactive move.
Here's a general approach:
Choose -3 or -5 if you want to try auto-merging. If conflicts arise during auto-merge, you will have the opportunity to review and resolve them. If you're uncomfortable with the changes or want to keep your existing configuration, choose -7 or -9 to discard the updates. Remember that it's essential to understand the changes being made to your configuration file, especially for critical services like network configuration (dhcpcd).
- User
- -5 is saver than -3
- ChatGPT Yes, you're correct. Option -5 is generally safer than option -3 in the context of etc-update in Gentoo. Here's why:
-3 (auto-merge all files): This option will automatically attempt to merge changes from the new configuration file into your existing one. While it can be convenient, it may not handle conflicts gracefully, and you might end up with unexpected changes or a broken configuration if conflicts arise.
-5 (auto-merge AND not use 'mv -i'): This option is similar to -3, but it doesn't use mv -i to move the new file into place. By skipping the interactive move, it reduces the risk of accidentally overwriting your existing configuration file. This extra caution makes it a safer choice, especially if you're uncertain about the changes.
So, if you're unsure about the changes in the configuration file or want to minimize the risk of unintended changes to your system, choosing -5 is a prudent choice. It allows you to review and
mv -i is a command in Unix-like operating systems, including Linux, that is used to move (rename) files or directories from one location to another. The -i option stands for "interactive," and when used with mv, it prompts the user for confirmation before overwriting an existing file with the same name in the target location.
$ sudo /usr/sbin/dispatch-conf --- /etc/dhcpcd.conf 2023-07-11 07:30:03.055998462 +0800 +++ /etc/._cfg0000_dhcpcd.conf 2023-09-13 14:21:14.576320016 +0800 @@ -46,5 +46,3 @@ #slaac hwaddr
OR generate Stable Private IPv6 Addresses based from the DUID
slaac private -# Don't attempt to obtain an IPv4LL address if we failed to get one via DHCP. See RFC 3927. -noipv4ll
(1 of 1) -- /etc/dhcpcd.conf q quit, h help, n next, e edit-new, z zap-new, u use-new m merge, t toggle-merge, l look-merge:
- /etc/dhcpcd.conf
A sample configuration for dhcpcd.
See dhcpcd.conf(5) for details.
Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
Inform the DHCP server of our hostname for DDNS.
#hostname
Use the hardware address of the interface for the Client ID.
#clientid
or
Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
Some non-RFC compliant DHCP servers do not reply with this set.
In this case, comment out duid and enable clientid above.
duid
Persist interface configuration when dhcpcd exits.
persistent
vendorclassid is set to blank to avoid sending the default of
dhcpcd-:::
vendorclassid
A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search option classless_static_routes
Respect the network MTU. This is applied to DHCP routes.
option interface_mtu
Request a hostname from the network
option host_name
Most distributions have NTP support.
#option ntp_servers
Rapid commit support.
Safe to enable by default because it requires the equivalent option set
on the server to actually work.
option rapid_commit
A ServerID is required by RFC2131.
require dhcp_server_identifier
Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
OR generate Stable Private IPv6 Addresses based from the DUID
slaac private
Don't attempt to obtain an IPv4LL address if we failed to get one via DHCP. See RFC 3927. <-- these two lines are removed after update
noipv4ll