From 057dff7fb667abdfb7e654ee8657a8afb85b5a68 Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Mon, 4 Jun 2018 16:00:49 +0200 Subject: specfile: network-scripts subpackage created --- doc/examples/ifcfg-bond-802.3ad | 16 ++++ doc/examples/ifcfg-bond-activebackup-arpmon | 17 ++++ doc/examples/ifcfg-bond-activebackup-miimon | 16 ++++ doc/examples/ifcfg-bond-slave | 12 +++ doc/examples/ifcfg-bridge | 12 +++ doc/examples/ifcfg-bridge-port | 9 ++ doc/examples/ifcfg-eth-alias | 12 +++ doc/examples/ifcfg-eth-dhcp | 14 +++ doc/examples/ifcfg-vlan | 13 +++ doc/examples/networking/ifcfg-bond-802.3ad | 16 ---- .../networking/ifcfg-bond-activebackup-arpmon | 17 ---- .../networking/ifcfg-bond-activebackup-miimon | 16 ---- doc/examples/networking/ifcfg-bond-slave | 12 --- doc/examples/networking/ifcfg-bridge | 12 --- doc/examples/networking/ifcfg-bridge-port | 9 -- doc/examples/networking/ifcfg-eth-alias | 12 --- doc/examples/networking/ifcfg-eth-dhcp | 14 --- doc/examples/networking/ifcfg-vlan | 13 --- initscripts.spec | 106 +++++++++++++++------ 19 files changed, 199 insertions(+), 149 deletions(-) create mode 100644 doc/examples/ifcfg-bond-802.3ad create mode 100644 doc/examples/ifcfg-bond-activebackup-arpmon create mode 100644 doc/examples/ifcfg-bond-activebackup-miimon create mode 100644 doc/examples/ifcfg-bond-slave create mode 100644 doc/examples/ifcfg-bridge create mode 100644 doc/examples/ifcfg-bridge-port create mode 100644 doc/examples/ifcfg-eth-alias create mode 100644 doc/examples/ifcfg-eth-dhcp create mode 100644 doc/examples/ifcfg-vlan delete mode 100644 doc/examples/networking/ifcfg-bond-802.3ad delete mode 100644 doc/examples/networking/ifcfg-bond-activebackup-arpmon delete mode 100644 doc/examples/networking/ifcfg-bond-activebackup-miimon delete mode 100644 doc/examples/networking/ifcfg-bond-slave delete mode 100644 doc/examples/networking/ifcfg-bridge delete mode 100644 doc/examples/networking/ifcfg-bridge-port delete mode 100644 doc/examples/networking/ifcfg-eth-alias delete mode 100644 doc/examples/networking/ifcfg-eth-dhcp delete mode 100644 doc/examples/networking/ifcfg-vlan diff --git a/doc/examples/ifcfg-bond-802.3ad b/doc/examples/ifcfg-bond-802.3ad new file mode 100644 index 00000000..973f181d --- /dev/null +++ b/doc/examples/ifcfg-bond-802.3ad @@ -0,0 +1,16 @@ +# ifcfg sample for bond in mode 4/802.3ad +# with static networking configuration +# lacp_rate=1 for fast LACPDU rx rate (optional) +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=bond0 +ONBOOT=yes +USERCTL=no +TYPE=Ethernet +BOOTPROTO=none +BONDING_OPTS="mode=4 lacp_rate=1" +IPADDR=192.168.1.4 +NETMASK=255.255.255.0 +GATEWAY=192.168.1.1 diff --git a/doc/examples/ifcfg-bond-activebackup-arpmon b/doc/examples/ifcfg-bond-activebackup-arpmon new file mode 100644 index 00000000..01acebac --- /dev/null +++ b/doc/examples/ifcfg-bond-activebackup-arpmon @@ -0,0 +1,17 @@ +# ifcfg sample for bond in active-backup mode using +# ARP monitoring. The ARP probes frequency (arp_interval) +# is 500ms and the target IP address (arp_ip_target) +# is 192.168.1.1 +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=bond0 +ONBOOT=yes +USERCTL=no +TYPE=Ethernet +BOOTPROTO=none +BONDING_OPTS="mode=1 arp_interval=500 arp_ip_target=192.168.1.1" +IPADDR=192.168.1.4 +NETMASK=255.255.255.0 +GATEWAY=192.168.1.1 diff --git a/doc/examples/ifcfg-bond-activebackup-miimon b/doc/examples/ifcfg-bond-activebackup-miimon new file mode 100644 index 00000000..befa2de3 --- /dev/null +++ b/doc/examples/ifcfg-bond-activebackup-miimon @@ -0,0 +1,16 @@ +# ifcfg sample for bond in active-backup mode using +# MII link monitoring. The MII status polling frequency +# (miimon) is 500ms. +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=bond0 +ONBOOT=yes +USERCTL=no +TYPE=Ethernet +BOOTPROTO=none +BONDING_OPTS="mode=1 miimon=500" +IPADDR=192.168.1.4 +NETMASK=255.255.255.0 +GATEWAY=192.168.1.1 diff --git a/doc/examples/ifcfg-bond-slave b/doc/examples/ifcfg-bond-slave new file mode 100644 index 00000000..7ae54793 --- /dev/null +++ b/doc/examples/ifcfg-bond-slave @@ -0,0 +1,12 @@ +# ifcfg sample for bond slave device +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=eth0 +TYPE=Ethernet +USERCTL=no +SLAVE=yes +MASTER=bond0 +BOOTPROTO=none +HWADDR=AA:BB:CC:DD:EE:FF diff --git a/doc/examples/ifcfg-bridge b/doc/examples/ifcfg-bridge new file mode 100644 index 00000000..346f6338 --- /dev/null +++ b/doc/examples/ifcfg-bridge @@ -0,0 +1,12 @@ +# ifcfg sample for linux bridge device with IP address. +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=br0 +TYPE=Bridge +IPADDR=192.168.1.1 +NETMASK=255.255.255.0 +ONBOOT=yes +BOOTPROTO=none +DELAY=0 diff --git a/doc/examples/ifcfg-bridge-port b/doc/examples/ifcfg-bridge-port new file mode 100644 index 00000000..0de4778c --- /dev/null +++ b/doc/examples/ifcfg-bridge-port @@ -0,0 +1,9 @@ +# ifcfg sample for a device that is a linux bridge port +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=eth1 +HWADDR=00:11:22:33:44:55 +ONBOOT=yes +BRIDGE=br0 diff --git a/doc/examples/ifcfg-eth-alias b/doc/examples/ifcfg-eth-alias new file mode 100644 index 00000000..60dc1d71 --- /dev/null +++ b/doc/examples/ifcfg-eth-alias @@ -0,0 +1,12 @@ +# ifcfg sample for alias interface on top of eth0 +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=eth0:0 +BOOTPROTO=none +IPADDR=192.168.1.1 +NETMASK=255.255.255.0 +ONBOOT=yes +USERCTL=no + diff --git a/doc/examples/ifcfg-eth-dhcp b/doc/examples/ifcfg-eth-dhcp new file mode 100644 index 00000000..58d46bf8 --- /dev/null +++ b/doc/examples/ifcfg-eth-dhcp @@ -0,0 +1,14 @@ +# ifcfg sample for common ethernet interfaces using DHCP +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=eth0 +BOOTPROTO=dhcp +HWADDR=00:11:22:33:44:55 +ONBOOT=yes + +# WARNING: When both DHCP_HOSTNAME and DHCP_FQDN are specified, +# only DHCP_FQDN will be used. +DHCP_HOSTNAME=host1 +DHCP_FQDN=host1.foo.bar.com diff --git a/doc/examples/ifcfg-vlan b/doc/examples/ifcfg-vlan new file mode 100644 index 00000000..d090aab0 --- /dev/null +++ b/doc/examples/ifcfg-vlan @@ -0,0 +1,13 @@ +# ifcfg sample for a VLAN device (vlanid=122) on top of +# eth0 device using static IP configuration +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +TYPE=Ethernet +DEVICE=eth0.122 +VLAN=yes +BOOTPROTO=none +NETMASK=255.255.255.0 +IPADDR=192.168.1.1 + diff --git a/doc/examples/networking/ifcfg-bond-802.3ad b/doc/examples/networking/ifcfg-bond-802.3ad deleted file mode 100644 index 973f181d..00000000 --- a/doc/examples/networking/ifcfg-bond-802.3ad +++ /dev/null @@ -1,16 +0,0 @@ -# ifcfg sample for bond in mode 4/802.3ad -# with static networking configuration -# lacp_rate=1 for fast LACPDU rx rate (optional) -# -# Please read /usr/share/doc/initscripts-*/sysconfig.txt -# for the documentation of these parameters. - -DEVICE=bond0 -ONBOOT=yes -USERCTL=no -TYPE=Ethernet -BOOTPROTO=none -BONDING_OPTS="mode=4 lacp_rate=1" -IPADDR=192.168.1.4 -NETMASK=255.255.255.0 -GATEWAY=192.168.1.1 diff --git a/doc/examples/networking/ifcfg-bond-activebackup-arpmon b/doc/examples/networking/ifcfg-bond-activebackup-arpmon deleted file mode 100644 index 01acebac..00000000 --- a/doc/examples/networking/ifcfg-bond-activebackup-arpmon +++ /dev/null @@ -1,17 +0,0 @@ -# ifcfg sample for bond in active-backup mode using -# ARP monitoring. The ARP probes frequency (arp_interval) -# is 500ms and the target IP address (arp_ip_target) -# is 192.168.1.1 -# -# Please read /usr/share/doc/initscripts-*/sysconfig.txt -# for the documentation of these parameters. - -DEVICE=bond0 -ONBOOT=yes -USERCTL=no -TYPE=Ethernet -BOOTPROTO=none -BONDING_OPTS="mode=1 arp_interval=500 arp_ip_target=192.168.1.1" -IPADDR=192.168.1.4 -NETMASK=255.255.255.0 -GATEWAY=192.168.1.1 diff --git a/doc/examples/networking/ifcfg-bond-activebackup-miimon b/doc/examples/networking/ifcfg-bond-activebackup-miimon deleted file mode 100644 index befa2de3..00000000 --- a/doc/examples/networking/ifcfg-bond-activebackup-miimon +++ /dev/null @@ -1,16 +0,0 @@ -# ifcfg sample for bond in active-backup mode using -# MII link monitoring. The MII status polling frequency -# (miimon) is 500ms. -# -# Please read /usr/share/doc/initscripts-*/sysconfig.txt -# for the documentation of these parameters. - -DEVICE=bond0 -ONBOOT=yes -USERCTL=no -TYPE=Ethernet -BOOTPROTO=none -BONDING_OPTS="mode=1 miimon=500" -IPADDR=192.168.1.4 -NETMASK=255.255.255.0 -GATEWAY=192.168.1.1 diff --git a/doc/examples/networking/ifcfg-bond-slave b/doc/examples/networking/ifcfg-bond-slave deleted file mode 100644 index 7ae54793..00000000 --- a/doc/examples/networking/ifcfg-bond-slave +++ /dev/null @@ -1,12 +0,0 @@ -# ifcfg sample for bond slave device -# -# Please read /usr/share/doc/initscripts-*/sysconfig.txt -# for the documentation of these parameters. - -DEVICE=eth0 -TYPE=Ethernet -USERCTL=no -SLAVE=yes -MASTER=bond0 -BOOTPROTO=none -HWADDR=AA:BB:CC:DD:EE:FF diff --git a/doc/examples/networking/ifcfg-bridge b/doc/examples/networking/ifcfg-bridge deleted file mode 100644 index 346f6338..00000000 --- a/doc/examples/networking/ifcfg-bridge +++ /dev/null @@ -1,12 +0,0 @@ -# ifcfg sample for linux bridge device with IP address. -# -# Please read /usr/share/doc/initscripts-*/sysconfig.txt -# for the documentation of these parameters. - -DEVICE=br0 -TYPE=Bridge -IPADDR=192.168.1.1 -NETMASK=255.255.255.0 -ONBOOT=yes -BOOTPROTO=none -DELAY=0 diff --git a/doc/examples/networking/ifcfg-bridge-port b/doc/examples/networking/ifcfg-bridge-port deleted file mode 100644 index 0de4778c..00000000 --- a/doc/examples/networking/ifcfg-bridge-port +++ /dev/null @@ -1,9 +0,0 @@ -# ifcfg sample for a device that is a linux bridge port -# -# Please read /usr/share/doc/initscripts-*/sysconfig.txt -# for the documentation of these parameters. - -DEVICE=eth1 -HWADDR=00:11:22:33:44:55 -ONBOOT=yes -BRIDGE=br0 diff --git a/doc/examples/networking/ifcfg-eth-alias b/doc/examples/networking/ifcfg-eth-alias deleted file mode 100644 index 60dc1d71..00000000 --- a/doc/examples/networking/ifcfg-eth-alias +++ /dev/null @@ -1,12 +0,0 @@ -# ifcfg sample for alias interface on top of eth0 -# -# Please read /usr/share/doc/initscripts-*/sysconfig.txt -# for the documentation of these parameters. - -DEVICE=eth0:0 -BOOTPROTO=none -IPADDR=192.168.1.1 -NETMASK=255.255.255.0 -ONBOOT=yes -USERCTL=no - diff --git a/doc/examples/networking/ifcfg-eth-dhcp b/doc/examples/networking/ifcfg-eth-dhcp deleted file mode 100644 index 58d46bf8..00000000 --- a/doc/examples/networking/ifcfg-eth-dhcp +++ /dev/null @@ -1,14 +0,0 @@ -# ifcfg sample for common ethernet interfaces using DHCP -# -# Please read /usr/share/doc/initscripts-*/sysconfig.txt -# for the documentation of these parameters. - -DEVICE=eth0 -BOOTPROTO=dhcp -HWADDR=00:11:22:33:44:55 -ONBOOT=yes - -# WARNING: When both DHCP_HOSTNAME and DHCP_FQDN are specified, -# only DHCP_FQDN will be used. -DHCP_HOSTNAME=host1 -DHCP_FQDN=host1.foo.bar.com diff --git a/doc/examples/networking/ifcfg-vlan b/doc/examples/networking/ifcfg-vlan deleted file mode 100644 index d090aab0..00000000 --- a/doc/examples/networking/ifcfg-vlan +++ /dev/null @@ -1,13 +0,0 @@ -# ifcfg sample for a VLAN device (vlanid=122) on top of -# eth0 device using static IP configuration -# -# Please read /usr/share/doc/initscripts-*/sysconfig.txt -# for the documentation of these parameters. - -TYPE=Ethernet -DEVICE=eth0.122 -VLAN=yes -BOOTPROTO=none -NETMASK=255.255.255.0 -IPADDR=192.168.1.1 - diff --git a/initscripts.spec b/initscripts.spec index b65c4b92..1d6b0cc5 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -39,12 +39,7 @@ Requires: systemd 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 @@ -102,6 +97,47 @@ network interfaces, some utilities, and other legacy files. # === SUBPACKAGES ============================================================= +%package -n network-scripts +Summary: Legacy scripts for manipulating of network devices +Requires: %{name}%{?_isa} = %{version}-%{release} + +Requires: bash +Requires: coreutils +Requires: dbus +Requires: gawk +Requires: grep +Requires: hostname +Requires: iproute +Requires: ipcalc +Requires: kmod +Requires: procps-ng +Requires: sed +Requires: systemd + +Requires(post): chkconfig +Requires(preun): chkconfig + +Requires(post): %{_sbindir}/update-alternatives +Requires(postun): %{_sbindir}/update-alternatives + +%description -n network-scripts +This package contains the legacy scripts for activating & deactivating of most +network interfaces. It also provides a legacy version of 'network' service. + +The 'network' service is enabled by default after installation of this package, +and if the network-scripts are installed alongside NetworkManager, then the +ifup/ifdown commands from network-scripts take precedence over the ones provided +by NetworkManager. + +If user has both network-scripts & NetworkManager installed, and wishes to +use ifup/ifdown from NetworkManager primarily, then they has to run command: + $ update-alternatives --config ifup + +Please note that running the command above will also disable the 'network' +service. + +# --------------- + %package -n netconsole-service Summary: Service for initializing of network console logging Requires: %{name}%{?_isa} = %{version}-%{release} @@ -165,7 +201,11 @@ support. Additional configuration is required after installation. rm -f %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifup-ctc %endif -ln -s %{_mandir}/man8/ifup.8 %{buildroot}%{_mandir}/man8/ifdown.8 +# Additional ways to access documentation: +install -m 0755 -d %{buildroot}%{_docdir}/network-scripts + +ln -s %{_docdir}/%{name}/sysconfig.txt %{buildroot}%{_docdir}/network-scripts/ +ln -sr %{_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 @@ -176,6 +216,15 @@ touch %{buildroot}%{_sbindir}/ifdown %post %systemd_post import-state.service loadmodules.service +%preun +%systemd_preun import-state.service loadmodules.service + +%postun +%systemd_postun import-state.service loadmodules.service + +# --------------- + +%post -n network-scripts chkconfig --add network > /dev/null 2>&1 || : [ -L %{_sbindir}/ifup ] || rm -f %{_sbindir}/ifup @@ -185,11 +234,7 @@ chkconfig --add network > /dev/null 2>&1 || : --slave %{_sbindir}/ifdown ifdown %{_sysconfdir}/sysconfig/network-scripts/ifdown \ --initscript network -# --------------- - -%preun -%systemd_preun import-state.service loadmodules.service - +%preun -n network-scripts if [ $1 -eq 0 ]; then chkconfig --del network > /dev/null 2>&1 || : %{_sbindir}/update-alternatives --remove ifup %{_sysconfdir}/sysconfig/network-scripts/ifup @@ -197,11 +242,6 @@ fi # --------------- -%postun -%systemd_postun import-state.service loadmodules.service - -# ============================================================================= - %post -n netconsole-service chkconfig --add netconsole > /dev/null 2>&1 || : @@ -225,7 +265,7 @@ fi %files -f %{name}.lang %license COPYING -%doc doc/* +%doc doc/sysconfig.txt # NOTE: /etc/profile.d/ is owned by setup package. # /etc/sysconfig/ is owned by filesystem package. @@ -234,19 +274,14 @@ fi %dir %{_sysconfdir}/rc.d/rc[0-6].d %dir %{_sysconfdir}/sysconfig/console %dir %{_sysconfdir}/sysconfig/modules -%dir %{_sysconfdir}/sysconfig/network-scripts %dir %{_libexecdir}/%{name} %dir %{_libexecdir}/%{name}/legacy-actions # --------------- -%config(noreplace) %{_sysconfdir}/sysconfig/network-scripts/ifcfg-lo - %ghost %config(noreplace, missingok) %verify(not md5 size mtime) %{_sysconfdir}/rc.d/rc.local %{_sysconfdir}/rc.d/init.d/functions -%{_sysconfdir}/rc.d/init.d/network -%{_sysconfdir}/sysconfig/network-scripts/* # RC symlinks: %{_sysconfdir}/rc[0-6].d @@ -258,11 +293,6 @@ fi %{_sbindir}/genhostid %{_sbindir}/service -%ghost %{_sbindir}/ifup -%ghost %{_sbindir}/ifdown - -%attr(4755,root,root) %{_sbindir}/usernetctl - %{_prefix}/lib/systemd/import-state %{_prefix}/lib/systemd/loadmodules %{_prefix}/lib/systemd/system/import-state.service @@ -272,10 +302,30 @@ fi %{_udevrulesdir}/* %{_mandir}/man1/* -%{_mandir}/man8/* +%{_mandir}/man8/service.* # ============================================================================= +%files -n network-scripts +%doc doc/examples/ +%dir %{_sysconfdir}/sysconfig/network-scripts + +%{_sysconfdir}/rc.d/init.d/network +%{_sysconfdir}/sysconfig/network-scripts/* + +%config(noreplace) %{_sysconfdir}/sysconfig/network-scripts/ifcfg-lo + +%ghost %{_sbindir}/ifup +%ghost %{_sbindir}/ifdown +%attr(4755,root,root) %{_sbindir}/usernetctl + +%{_mandir}/man8/ifup.* +%{_mandir}/man8/ifdown.* +%{_mandir}/man8/usernetctl.* +%{_docdir}/network-scripts/* + +# --------------- + %files -n netconsole-service %{_sysconfdir}/rc.d/init.d/netconsole %config(noreplace) %{_sysconfdir}/sysconfig/netconsole -- cgit v1.2.1