Skip to content

Commit

Permalink
netconsole: source sysconfig/network only if it exists
Browse files Browse the repository at this point in the history
Although the comment said "check if network is up",
the code only sourced the configuration file, but did not fail
if it did not exist and happily continued.

Also on current versions of Fedora, the sysconfig/network
does not exist by default, so you see a warning message
when you start the service.

So let's just check if the file exists and only source it
if it does (for backwards compatibility).
  • Loading branch information
lnykryn committed Aug 27, 2024
1 parent 073cb44 commit ecb85c0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions usr/libexec/netconsole
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ PATH=/sbin:/usr/sbin:$PATH
RETVAL=0
SERVER_ADDRESS_RESOLUTION=

# Check that networking is up.
. /etc/sysconfig/network
[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network

# Source function library.
. /etc/rc.d/init.d/functions
Expand Down

0 comments on commit ecb85c0

Please sign in to comment.