#964 PR merged: USE_STATIC_NETWORKING now really overrides USE_DHCLIENT.

Labels: bug, fixed / solved / done

gozora opened issue at 2016-08-16 11:20:

In default.conf we have comment:

Say "y", "Yes" (or any not empty string) to enable static networking (overrules USE_DHCLIENT):

This is currently not true, because doesn't matter how is USE_STATIC_NETWORKING set, dhcp configuration will be triggered in rear recover.

jsmeix commented at 2016-08-16 12:50:

@gozora
I think you may have fixed it at the wrong place.

I think prep/GNU/Linux/21_include_dhclient.sh is meant
to prepare the recovery system so that dhclient can be
used from within the recovery system and the sufficient
condition for that is a non-empty USE_DHCLIENT.

I think USE_STATIC_NETWORKING is not meant
to have no dhclient binary in the recovery system
but it is meant that no dhclient binary is automatically
run in the recovery system.

In short - I would expect that with

USE_DHCLIENT="yes"
USE_STATIC_NETWORKING="yes"

I get a dhclient binary in the recovery system
but there is no automated networking setup
in the recovery system via dhclient.
I.e. if I want I could run dhclient manually
in the recovery system.

I think you need to fix it in the system-setup setup scripts
of the recovery system, probably something like
skel/default/etc/scripts/system-setup.d/58-start-dhclient.sh

I guess therein the

[[ -z "$USE_DHCLIENT"  ]] && return

is insufficient and should be probably something like

# without USE_DHCLIENT there is no dhclient binary in the recovery system
# so that networking setup via DHCP is not possible:
test "$USE_DHCLIENT" || return
# with USE_STATIC_NETWORKING no networking setup via DHCP must happen
# see default.conf: USE_STATIC_NETWORKING overrules USE_DHCLIENT
test "$USE_STATIC_NETWORKING" && return

jsmeix commented at 2016-08-16 12:52:

@gdha I added you here because I think you implemented
USE_STATIC_NETWORKING and know best how that
is menat to be used together with USE_DHCLIENT.

gozora commented at 2016-08-16 13:05:

I get a dhclient binary in the recovery system
but there is no automated networking setup
in the recovery system via dhclient.
I.e. if I want I could run dhclient manually
in the recovery system.

This is exactly what this patch is doing ;-). You have DHCP client bin in your recovery system it is just not executed.

I can only agree that it makes more sense to put it into 58-start-dhclient.sh, will correct it ...

jsmeix commented at 2016-08-16 13:17:

I do not undrestand how with your initial commit via

if [[ ! -z "$USE_DHCLIENT" && -z "$USE_STATIC_NETWORKING" ]]; then
     REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" $DHCLIENT_BIN $DHCLIENT6_BIN )

the dhclient binaries get added to the recovery system even for

USE_DHCLIENT="yes"
USE_STATIC_NETWORKING="yes"

jsmeix commented at 2016-08-16 13:20:

Stupid me!
The

! -z "$USE_DHCLIENT" && -z "$USE_STATIC_NETWORKING"

condition is obviously already too complicated for me
(while simultaneously working on https://github.com/rear/rear/issues/963 ;-)

gozora commented at 2016-08-16 13:32:

:-) now it should be more readable ...
My initial problem was that I've set USE_STATIC_NETWORKING in site.conf which seems not to be parsed during rear recover boot stage.
Setting it to local.conf works just fine ...


[Export of Github issue for rear/rear.]