#2354 Issue closed: 58-start-dhclient.sh fails to start dhclient unless USE_STATIC_NETWORKING=no

Labels: bug, fixed / solved / done

OliverO2 opened issue at 2020-04-02 20:30:

58-start-dhclient.sh currently will not start dhclient unless USE_STATIC_NETWORKING is explicitly set to no (or its variants).

Expected behavior: As of release 2.5, not setting USE_STATIC_NETWORKING did start dhclient. Starting dhclient was only skipped if USE_STATIC_NETWORKING was explicitly set to yes (or its variants).

I suspect that this line is contrary to intentions:
https://github.com/rear/rear/blob/161be72fcd89f2af23f49f32c21d2b049aae803d/usr/share/rear/skel/default/etc/scripts/system-setup.d/58-start-dhclient.sh#L9

It should probably read:

is_true $USE_STATIC_NETWORKING && return

That way, an empty value (the default) will not turn off DHCP.

Related: #2323, #2325

jsmeix commented at 2020-04-03 11:35:

I think this was my fault
https://github.com/rear/rear/pull/2325#discussion_r374721559

Too much ternary logic plus negations for my poor mind :-(

jsmeix commented at 2020-04-03 12:44:

@OliverO2
thank you for your analysis that shows the root cause of it.

I fixed it via
https://github.com/rear/rear/commit/89ddec66d689cf1ed6fa14701efba38bae1021fb


[Export of Github issue for rear/rear.]