fedora-sysv / initscripts

📜 Scripts to bring up network interfaces and legacy utilities in Fedora.
GNU General Public License v2.0
46 stars 52 forks source link

Setting RES_OPTIONS in /etc/sysconfig/network is not documented anywhere #320

Closed ghost closed 3 years ago

ghost commented 4 years ago

There are four man pages for dhclient, a man page for nm-settings-ifcfg-rh and also /usr/share/doc/initscripts/sysconfig.txt but nothing mentions that if you put RES_OPTIONS = rotate into /etc/sysconfig/network that /usr/sbin/dhclient-script will add options rotate to /etc/resolv.conf. There is an indication in the resolv.conf(5) man page that RES_OPTIONS comes from the environment but it does not mention how to set RES_OPTIONS into the environment. There is an indication in the nm-settings-ifcfg-rh(5) man page that RES_OPTIONS is an Ifcfg-rh variable but nothing about the fact that you set RES_OPTIONS in /etc/sysconfig/network.

You can see that it does by examining /usr/sbin/dhclient-script

if [ -f /etc/sysconfig/network ]; then
    . /etc/sysconfig/network
fi
... skip backward to the function definition: make_resolv_conf() ...

        if [ -n "${RES_OPTIONS}" ]; then
            echo "options ${RES_OPTIONS}" >> "${rscf}"
        fi

There is a section in /usr/share/doc/initscripts/sysconfig.txt named /etc/sysconfig/network so that would make a good place for documentation about the RES_OPTIONS.