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 370b5f4 commit 3e54b73
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 @@ -21,8 +21,7 @@
PATH=/sbin:/usr/sbin:$PATH
RETVAL=0

# 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 3e54b73

Please sign in to comment.