Skip to content

Conversation

@gozora
Copy link
Member

@gozora gozora commented Aug 16, 2016

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.

Before even if set, dhcp configuration was used in rear recover.
@jsmeix
Copy link
Member

jsmeix commented Aug 16, 2016

@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 jsmeix added the bug The code does not do what it is meant to do label Aug 16, 2016
@jsmeix jsmeix added this to the Rear v1.19 milestone Aug 16, 2016
@jsmeix
Copy link
Member

jsmeix commented Aug 16, 2016

@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
Copy link
Member Author

gozora commented Aug 16, 2016

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
Copy link
Member

jsmeix commented Aug 16, 2016

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
Copy link
Member

jsmeix commented Aug 16, 2016

Stupid me!
The

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

condition is obviously already too complicated for me
(while simultaneously working on #963 ;-)

@gozora
Copy link
Member Author

gozora commented Aug 16, 2016

:-) 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 ...

@jsmeix jsmeix merged commit 638dd73 into rear:master Aug 16, 2016
@gozora gozora deleted the static_network branch August 16, 2016 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug The code does not do what it is meant to do fixed / solved / done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants