ifupdown: Revert the tmpfiles.d change as the dir is created too late

It looks like on my tests with the sysmobts I was saved by
busybox-ifplogd executing ifup again. I couldn't figure out
the dependencies between the LSB networking service and the
tmpfiles.d interaction. So instead of winning a beauty contest
we will need to create the directory by hand.

Cause: SYS#1514

Revert "ifupdown: Package the new file as well"
This reverts commit 15dc869cda.
Revert "ifupdown: Try the workdir for the files we copied"
This reverts commit 1ef790672e.
Revert "ifupdown: Create /run/network through a tmpfiles.d"
This reverts commit e0c7f3c621.
This commit is contained in:
Holger Hans Peter Freyther 2015-04-20 09:39:49 -04:00
parent 7843fb4085
commit c32b0df2e3
4 changed files with 184 additions and 7 deletions

View File

@ -0,0 +1,91 @@
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: networking
# Required-Start: mountvirtfs $local_fs
# Required-Stop: $local_fs
# Should-Start: ifupdown
# Should-Stop: ifupdown
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Raise network interfaces.
### END INIT INFO
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
[ -x /sbin/ifup ] || exit 0
check_network_file_systems() {
[ -e /proc/mounts ] || return 0
if [ -e /etc/iscsi/iscsi.initramfs ]; then
echo "not deconfiguring network interfaces: iSCSI root is mounted."
exit 0
fi
exec 9<&0 < /proc/mounts
while read DEV MTPT FSTYPE REST; do
case $DEV in
/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
echo "not deconfiguring network interfaces: network devices still mounted."
exit 0
;;
esac
case $FSTYPE in
nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)
echo "not deconfiguring network interfaces: network file systems still mounted."
exit 0
;;
esac
done
exec 0<&9 9<&-
}
check_network_swap() {
[ -e /proc/swaps ] || return 0
exec 9<&0 < /proc/swaps
while read DEV MTPT FSTYPE REST; do
case $DEV in
/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
echo "not deconfiguring network interfaces: network swap still mounted."
exit 0
;;
esac
done
exec 0<&9 9<&-
}
case "$1" in
start)
echo -n "Configuring network interfaces... "
mkdir /run/network || true
sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
ifup -a
echo "done."
;;
stop)
check_network_file_systems
check_network_swap
echo -n "Deconfiguring network interfaces... "
ifdown -a
echo "done."
;;
force-reload|restart)
echo "Running $0 $1 is deprecated because it may not enable again some interfaces"
echo "Reconfiguring network interfaces... "
ifdown -a || true
ifup -a
echo "done."
;;
*)
echo "Usage: /etc/init.d/networking {start|stop}"
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,91 @@
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: networking
# Required-Start: mountvirtfs $local_fs
# Required-Stop: $local_fs
# Should-Start: ifupdown
# Should-Stop: ifupdown
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Raise network interfaces.
### END INIT INFO
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
[ -x /sbin/ifup ] || exit 0
check_network_file_systems() {
[ -e /proc/mounts ] || return 0
if [ -e /etc/iscsi/iscsi.initramfs ]; then
echo "not deconfiguring network interfaces: iSCSI root is mounted."
exit 0
fi
exec 9<&0 < /proc/mounts
while read DEV MTPT FSTYPE REST; do
case $DEV in
/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
echo "not deconfiguring network interfaces: network devices still mounted."
exit 0
;;
esac
case $FSTYPE in
nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)
echo "not deconfiguring network interfaces: network file systems still mounted."
exit 0
;;
esac
done
exec 0<&9 9<&-
}
check_network_swap() {
[ -e /proc/swaps ] || return 0
exec 9<&0 < /proc/swaps
while read DEV MTPT FSTYPE REST; do
case $DEV in
/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
echo "not deconfiguring network interfaces: network swap still mounted."
exit 0
;;
esac
done
exec 0<&9 9<&-
}
case "$1" in
start)
echo -n "Configuring network interfaces... "
mkdir /run/network || true
sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
ifup -a
echo "done."
;;
stop)
check_network_file_systems
check_network_swap
echo -n "Deconfiguring network interfaces... "
ifdown -a
echo "done."
;;
force-reload|restart)
echo "Running $0 $1 is deprecated because it may not enable again some interfaces"
echo "Reconfiguring network interfaces... "
ifdown -a || true
ifup -a
echo "done."
;;
*)
echo "Usage: /etc/init.d/networking {start|stop}"
exit 1
;;
esac
exit 0

View File

@ -1 +0,0 @@
d /run/network - - - -

View File

@ -7,7 +7,6 @@ LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://debian/copyright;md5=7adfbe801102d1e7e6bfdd3f03754efa"
SRC_URI = "https://launchpadlibrarian.net/194033720/ifupdown_${PV}.tar.xz \
file://ifupdown.conf \
file://busybox-yocto-compat.patch "
SRC_URI[md5sum] = "bb204ae2fa4171d6f1de4097f4570a7d"
@ -15,7 +14,7 @@ SRC_URI[sha256sum] = "8a0647c59ee0606f5da9205c5b3c5b000fea98fe39348f6bb2cba5fecf
CFLAGS += "-D'IFUPDOWN_VERSION="0.7"'"
PR = "r3"
PR = "r2"
do_configure() {
chmod a+rx makecdep.sh makenwdep.sh
@ -27,9 +26,6 @@ do_install() {
ln -s ${base_sbindir}/ifup.${BPN} ${D}${base_sbindir}/ifdown.${BPN}
ln -s ${base_sbindir}/ifup.${BPN} ${D}${base_sbindir}/ifquery
install -D -m 0755 settle-dad.sh ${D}/lib/ifupdown/settle-dad.sh
install -d ${D}${libdir}/tmpfiles.d
install -m 0644 ${WORKDIR}/ifupdown.conf ${D}${libdir}/tmpfiles.d/
}
inherit update-alternatives
@ -44,4 +40,4 @@ ALTERNATIVE_TARGET[ifup] = "${base_sbindir}/ifup.${BPN}"
ALTERNATIVE_LINK_NAME[ifdown] = "${base_sbindir}/ifdown"
ALTERNATIVE_TARGET[ifdown] = "${base_sbindir}/ifdown.${BPN}"
FILES_${PN} += "/lib/ifupdown/settle-dad.sh ${libdir}/tmpfiles.d/*"
FILES_${PN} += "/lib/ifupdown/settle-dad.sh"