#52 manipulate network service in %post (#1369794)
Merged 7 years ago by kevin. Opened 7 years ago by adamwill.
adamwill/fedora-kickstarts network-enable-post  into  f25

file modified
+4 -1
@@ -9,7 +9,6 @@ 

  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 @@ 

  #

  %post

  

+ # Enable network service here, as doing it in the services line

+ # fails due to RHBZ #1369794

+ /sbin/chkconfig network on

+ 

  %end

  

file modified
+5 -1
@@ -14,7 +14,7 @@ 

  # 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 @@ 

  

  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

  

file modified
+5 -2
@@ -21,8 +21,7 @@ 

  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 "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

  

@@ -14,7 +14,7 @@ 

  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 @@ 

  # 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

file modified
+5 -1
@@ -39,7 +39,7 @@ 

  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 @@ 

  # 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

  

file modified
+5 -1
@@ -26,7 +26,7 @@ 

  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 @@ 

  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

  

file modified
+5 -1
@@ -17,7 +17,7 @@ 

  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 @@ 

  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

  

file modified
+5 -1
@@ -17,7 +17,7 @@ 

  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 @@ 

  # 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

  

  

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.

We probably want this on both master and f25.

In case you're wondering why more image composes don't fail - attempts to disable services failing are non-fatal, it's only attempts to enable services failing that's fatal. So in all the cases where we were trying to disable the network service, it was failing, but anaconda was just logging a warning and carrying on.

Pull-Request has been merged by kevin

7 years ago

Each branch that is changed needs a separate pull request. If you want, I can rebase the patch on master and submit another pull request that could be approved by you or someone else?

nirik just went ahead and cherrypicked it without going through the PR process. I've done that a couple of times too, for f25<->master things; it seems kinda overkill to file a separate PR for every branch every time, particularly for the two dev branches.

Yeah, but we seem to be moving to a more formal process that will make tracking easier. I thought I was taking some reasonable short cuts, but releng expressed they would like to see less of that. In this case I think there might be a pagure feature request. I would think a rebase of a pull request for another request on a different branch would come up enough that there should be a way to do it in pagure with a couple of clicks. So I'll bug those guys with yet another feature request.