Paul Aurich 13b88ca8ee scripts/functions: Don't die if configure_networking times out
If configuring the network times out, there will be no /run/net-*.conf
files present, and the attempt to source any interface config file will
fail. In this failure mode, dash (or 'bash --posix') immediately exits,
regardless of 'set -e' or not.

This precludes a caller from (cleanly) handling network bring-up
failure, particularly if the caller cares about the variables set from
sourcing the ipconfig config file.

    paul@haley ~ % cat repro.sh
    #!/bin/sh

    . /nonexistent
    echo hello
    paul@haley ~ % dash ./repro.sh
    ./repro.sh: 3: .: cannot open /nonexistent: No such file
    paul@haley ~ % sh ./repro.sh
    ./repro.sh: 3: .: cannot open /nonexistent: No such file
    paul@haley ~ % bash ./repro.sh
    ./repro.sh: line 3: /nonexistent: No such file or directory
    hello
    paul@haley ~ % bash --posix ./repro.sh
    ./repro.sh: line 3: /nonexistent: No such file or directory
    paul@haley ~ %

Co-authored-by: Pierre Neyron <pierre.neyron@imag.fr>
Closes: #1025730
2024-05-17 19:51:39 -07:00
..