aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--initscripts.spec19
2 files changed, 17 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index cec6c103..c5b6d3a4 100644
--- a/Makefile
+++ b/Makefile
@@ -74,10 +74,6 @@ install-network-scripts: install-usr install-etc
install -m 0755 -d $(DESTDIR)$(sysconfdir)/sysconfig/network-scripts
cp -a network-scripts/* $(DESTDIR)$(sysconfdir)/sysconfig/network-scripts/
(cd $(DESTDIR)$(sysconfdir)/sysconfig/network-scripts; \
- mv ifup $(DESTDIR)$(sbindir)/; \
- mv ifdown $(DESTDIR)$(sbindir)/; \
- ln -sf $(sbindir)/ifup . ; \
- ln -sf $(sbindir)/ifdown . ; \
ln -sf ifup-ippp ifup-isdn ; \
ln -sf ifdown-ippp ifdown-isdn ; \
)
diff --git a/initscripts.spec b/initscripts.spec
index 4113b649..fda9d6c8 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -41,7 +41,10 @@ Requires: util-linux >= 2.16
Requires(pre): shadow-utils
Requires(post): chkconfig
Requires(post): coreutils
+Requires(post): %{_sbindir}/update-alternatives
+
Requires(preun): chkconfig
+Requires(postun): %{_sbindir}/update-alternatives
BuildRequires: filesystem >= 3
BuildRequires: gcc
@@ -121,6 +124,10 @@ network interfaces, some utilities, and other legacy files.
ln -s %{_mandir}/man8/ifup.8 %{buildroot}%{_mandir}/man8/ifdown.8
+# We are now using alternatives approach to better co-exist with NetworkManager:
+touch %{buildroot}%{_sbindir}/ifup
+touch %{buildroot}%{_sbindir}/ifdown
+
# ---------------
%post
@@ -129,6 +136,12 @@ ln -s %{_mandir}/man8/ifup.8 %{buildroot}%{_mandir}/man8/ifdown.8
chkconfig --add network > /dev/null 2>&1 || :
chkconfig --add netconsole > /dev/null 2>&1 || :
+[ -L %{_sbindir}/ifup ] || rm -f %{_sbindir}/ifup
+[ -L %{_sbindir}/ifdown ] || rm -f %{_sbindir}/ifdown
+
+%{_sbindir}/update-alternatives --install %{_sbindir}/ifup ifup %{_sysconfdir}/sysconfig/network-scripts/ifup 90 \
+ --slave %{_sbindir}/ifdown ifdown %{_sysconfdir}/sysconfig/network-scripts/ifdown
+
# ---------------
%preun
@@ -137,6 +150,7 @@ chkconfig --add netconsole > /dev/null 2>&1 || :
if [ $1 -eq 0 ]; then
chkconfig --del network > /dev/null 2>&1 || :
chkconfig --del netconsole > /dev/null 2>&1 || :
+ %{_sbindir}/update-alternatives --remove ifup %{_sysconfdir}/sysconfig/network-scripts/ifup
fi
# ---------------
@@ -193,14 +207,15 @@ fi
# ---------------
%{_bindir}/*
-%{_sbindir}/ifup
-%{_sbindir}/ifdown
%{_sbindir}/consoletype
%{_sbindir}/genhostid
%{_sbindir}/service
%{_sbindir}/sushell
%{_sbindir}/sys-unconfig
+%ghost %{_sbindir}/ifup
+%ghost %{_sbindir}/ifdown
+
%attr(2755,root,root) %{_sbindir}/netreport
%attr(4755,root,root) %{_sbindir}/usernetctl