Skip to content

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 ~ %

Closes: #1025730

Merge request reports

Loading