Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network-scripts: ifup-local is never run for bridge member interfaces #296

Open
davide125 opened this issue Dec 12, 2019 · 1 comment
Open
Assignees
Labels

Comments

@davide125
Copy link
Member

ifup-eth currently calls exit 0 when setting up a bridge member interface, which leads to ifup-local never being run. We're currently working around this in our environment with this /sbin/ifup-pre-local script.

#!/bin/bash

. /etc/init.d/functions

cd /etc/sysconfig/network-scripts
. ./network-functions

[ -f ../network ] && . ../network

CONFIG=${1}

need_config "${CONFIG}"

source_config

# If we're not setting up a bridge member interface, exit now
[ -z "${BRIDGE}" -a -z "${OVS_BRIDGE}" ] && exit 0

# This will run ifup-eth, then ifup-local, but then /sbin/ifup (our caller)
# will RE-RUN ifup-eth. This seems to be ok in practice, as most of the things
# ifup-eth does are idempotent. Note that we have to do this because ifup-eth
# will 'exit 0' in the middle when setting up a bridge member interface, thus
# preventing ifup-local from even being called.
OTHERSCRIPT="/etc/sysconfig/network-scripts/ifup-${DEVICETYPE}"

if [ ! -x ${OTHERSCRIPT} ]; then
  OTHERSCRIPT="/etc/sysconfig/network-scripts/ifup-eth"
fi

${OTHERSCRIPT} ${CONFIG} $2

if [ -x /sbin/ifup-local ]; then
  /sbin/ifup-local ${DEVICE}
fi

# give it some time to settle
sleep 2

exit 0

Note: this is a long standing bug, dating back to at least 2014, but I'd forgotten to file it until now.

@davide125
Copy link
Member Author

is where the exit 0 happens

@jamacku jamacku self-assigned this Mar 5, 2020
@jamacku jamacku added the bug label Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants