From 4fc84a77a21c966e098051cbba7ba209490fbd41 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 24 Aug 2016 09:50:38 -0700 Subject: [PATCH] manipulate network service in %post (#1369794) Due to #1369794 , anaconda cannot currently manipulate sysv services in F25+. So to work around this, take 'network' out of the services lines in all kickstarts and instead manipulate it in the %post section, with chkconfig. Also remove rsyslog from the Atomic image services line because it doesn't appear to be included in the OStree tree at present and so attempting to enable the service breaks Atomic image compose, see e.g.: https://kojipkgs.fedoraproject.org//work/tasks/9022/15349022/oz-x86_64.log also correct the name of the ssh service in fedora-arm-base.ks; it's sshd not ssh. --- fedora-aos.ks | 5 ++++- fedora-arm-base.ks | 6 +++++- fedora-atomic.ks | 7 +++++-- fedora-cloud-atomic-pxetolive.ks | 7 ++++++- fedora-cloud-base.ks | 6 +++++- fedora-cloud-bigdata.ks | 6 +++++- fedora-cloud-experimental.ks | 6 +++++- fedora-live-base.ks | 6 +++++- 8 files changed, 40 insertions(+), 9 deletions(-) diff --git a/fedora-aos.ks b/fedora-aos.ks index 8e5c3b5..eebe314 100644 --- a/fedora-aos.ks +++ b/fedora-aos.ks @@ -9,7 +9,6 @@ selinux --permissive firewall --disabled bootloader --timeout=1 --append="acpi=force" network --bootproto=dhcp --device=eth0 --onboot=on -services --enabled=network # Uncomment the next line # to make the root password be thincrust @@ -95,5 +94,9 @@ generic-logos # %post +# Enable network service here, as doing it in the services line +# fails due to RHBZ #1369794 +/sbin/chkconfig network on + %end diff --git a/fedora-arm-base.ks b/fedora-arm-base.ks index c2a9641..4017924 100644 --- a/fedora-arm-base.ks +++ b/fedora-arm-base.ks @@ -14,7 +14,7 @@ part / --size=3584 --fstype ext4 # make sure that initial-setup runs and lets us do all the configuration bits firstboot --reconfig -services --enabled=ssh,NetworkManager,avahi-daemon,rsyslog,chronyd,initial-setup --disabled=network +services --enabled=sshd,NetworkManager,avahi-daemon,rsyslog,chronyd,initial-setup %include fedora-repo.ks @@ -74,5 +74,9 @@ systemctl mask tmp.mount dnf -y remove dracut-config-generic +# Disable network service here, as doing it in the services line +# fails due to RHBZ #1369794 +/sbin/chkconfig network off + %end diff --git a/fedora-atomic.ks b/fedora-atomic.ks index 5c5931d..d850739 100644 --- a/fedora-atomic.ks +++ b/fedora-atomic.ks @@ -21,8 +21,7 @@ firewall --disabled bootloader --timeout=1 --append="no_timer_check console=tty1 console=ttyS0,115200n8" network --bootproto=dhcp --device=link --activate --onboot=on -services --disabled=network -services --enabled=sshd,rsyslog,cloud-init,cloud-init-local,cloud-config,cloud-final +services --enabled=sshd,cloud-init,cloud-init-local,cloud-config,cloud-final zerombr clearpart --all @@ -125,5 +124,9 @@ echo "(Don't worry -- that out-of-space error was expected.)" echo "Adding Developer Mode GRUB2 menu item." /usr/libexec/atomic-devmode/bootentry add +# Disable network service here, as doing it in the services line +# fails due to RHBZ #1369794 +/sbin/chkconfig network off + %end diff --git a/fedora-cloud-atomic-pxetolive.ks b/fedora-cloud-atomic-pxetolive.ks index 4c67673..d865ccc 100644 --- a/fedora-cloud-atomic-pxetolive.ks +++ b/fedora-cloud-atomic-pxetolive.ks @@ -14,7 +14,7 @@ network --bootproto=dhcp --device=link --activate part / --fstype="ext4" --size=6000 part /boot --size=500 --fstype="ext4" shutdown -services --disabled=docker-storage-setup,network +services --disabled=docker-storage-setup services --enabled=NetworkManager,sshd,cloud-init,cloud-init-local,cloud-config,cloud-final ostreesetup --nogpg --osname=fedora-atomic --remote=fedora-atomic --url=http://kojipkgs.fedoraproject.org/mash/atomic/22/ --ref=fedora-atomic/f22/x86_64/docker-host @@ -28,4 +28,9 @@ userdel -r none # We copy content of separate /boot partition to root part when building live squashfs image, # and we don't want systemd to try to mount it when pxe booting cat /dev/null > /etc/fstab + +# Disable network service here, as doing it in the services line +# fails due to RHBZ #1369794 +/sbin/chkconfig network off + %end diff --git a/fedora-cloud-base.ks b/fedora-cloud-base.ks index 07635eb..a7546f0 100644 --- a/fedora-cloud-base.ks +++ b/fedora-cloud-base.ks @@ -39,7 +39,7 @@ firewall --disabled bootloader --timeout=1 --append="no_timer_check console=tty1 console=ttyS0,115200n8" --extlinux network --bootproto=dhcp --device=link --activate --onboot=on -services --enabled=network,sshd,rsyslog,cloud-init,cloud-init-local,cloud-config,cloud-final +services --enabled=sshd,rsyslog,cloud-init,cloud-init-local,cloud-config,cloud-final zerombr clearpart --all @@ -265,5 +265,9 @@ echo "(Don't worry -- that out-of-space error was expected.)" # For trac ticket https://fedorahosted.org/cloud/ticket/128 rm -f /etc/sysconfig/network-scripts/ifcfg-ens3 +# Enable network service here, as doing it in the services line +# fails due to RHBZ #1369794 +/sbin/chkconfig network on + %end diff --git a/fedora-cloud-bigdata.ks b/fedora-cloud-bigdata.ks index 987ee5f..9e3d4c1 100644 --- a/fedora-cloud-bigdata.ks +++ b/fedora-cloud-bigdata.ks @@ -26,7 +26,7 @@ firewall --disabled bootloader --timeout=1 --append="no_timer_check console=tty1 console=ttyS0,115200n8" --extlinux network --bootproto=dhcp --device=eth0 --activate --onboot=on -services --enabled=network,sshd,rsyslog,cloud-init,cloud-init-local,cloud-config,cloud-final +services --enabled=sshd,rsyslog,cloud-init,cloud-init-local,cloud-config,cloud-final zerombr clearpart --all @@ -219,5 +219,9 @@ dd bs=1M if=/dev/zero of=/var/tmp/zeros || : rm -f /var/tmp/zeros echo "(Don't worry -- that out-of-space error was expected.)" +# Enable network service here, as doing it in the services line +# fails due to RHBZ #1369794 +/sbin/chkconfig network on + %end diff --git a/fedora-cloud-experimental.ks b/fedora-cloud-experimental.ks index 02a0030..85dca8d 100644 --- a/fedora-cloud-experimental.ks +++ b/fedora-cloud-experimental.ks @@ -17,7 +17,7 @@ firewall --disabled bootloader --timeout=1 --append="no_timer_check console=tty1 console=ttyS0,115200n8" --extlinux network --bootproto=dhcp --device=eth0 --activate --onboot=on -services --enabled=network,sshd,rsyslog,cloud-init,cloud-init-local,cloud-config,cloud-final +services --enabled=sshd,rsyslog,cloud-init,cloud-init-local,cloud-config,cloud-final zerombr clearpart --all @@ -211,5 +211,9 @@ dd bs=1M if=/dev/zero of=/var/tmp/zeros || : rm -f /var/tmp/zeros echo "(Don't worry -- that out-of-space error was expected.)" +# Enable network service here, as doing it in the services line +# fails due to RHBZ #1369794 +/sbin/chkconfig network on + %end diff --git a/fedora-live-base.ks b/fedora-live-base.ks index 6ee8bdc..d1401a4 100644 --- a/fedora-live-base.ks +++ b/fedora-live-base.ks @@ -17,7 +17,7 @@ xconfig --startxonboot zerombr clearpart --all part / --size 5120 --fstype ext4 -services --enabled=NetworkManager,ModemManager --disabled=network,sshd +services --enabled=NetworkManager,ModemManager --disabled=sshd network --bootproto=dhcp --device=link --activate shutdown @@ -321,6 +321,10 @@ echo 'File created by kickstart. See systemd-update-done.service(8).' \ # See bug 1317709 rm -f /boot/*-rescue* +# Disable network service here, as doing it in the services line +# fails due to RHBZ #1369794 +/sbin/chkconfig network off + %end