Skip to content

Instantly share code, notes, and snippets.

@goodtune
Created November 28, 2018 10:47
Show Gist options
  • Save goodtune/4afcbbbec9badf071ed4775f94899e69 to your computer and use it in GitHub Desktop.
Save goodtune/4afcbbbec9badf071ed4775f94899e69 to your computer and use it in GitHub Desktop.
Using a modern systemd to CentOS 7.x

Using a modern systemd on CentOS 7.x

Unfortunately the systemd that ships with CentOS 7.x is stalled at v219 - that is pretty old now, and there are some great features you're missing out on.

Thankfully facebookincubator/rpm-backports and https://copr.fedorainfracloud.org/coprs/jsynacek/systemd-backports-for-centos-7/ have come to the rescue!

Note: you really need to pay attention to the SELinux comment - if you don't disable it you're probably going to brick your host. Thankfully I tried this in a disposable vagrant first...

Disable SELinux

Check if you need to.

$ getenforce 
Enforcing

If your policy is Enforcing as above, you'll want to turn it off.

  1. edit /etc/sysconfig/grub and add selinux=0 to the end of GRUB_CMDLINE_LINUX.
  2. run grub2-mkconfig > /boot/grub2/grub.cfg
  3. reboot

After your reboot you should find SELinux has been disabled.

$ getenforce 
Disabled

Add yum repo and upgrade systemd

  1. wget https://copr.fedorainfracloud.org/coprs/jsynacek/systemd-backports-for-centos-7/repo/epel-7/jsynacek-systemd-backports-for-centos-7-epel-7.repo -O /etc/yum.repos.d/jsynacek-systemd-centos-7.repo
  2. yum upgrade systemd
  3. reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment