diff --git a/share/runtime-postinstall.tmpl b/share/runtime-postinstall.tmpl index bba56308..7d5f17e2 100644 --- a/share/runtime-postinstall.tmpl +++ b/share/runtime-postinstall.tmpl @@ -43,6 +43,9 @@ systemctl mask rhel-configure.service rhel-loadmodules.service \ rhel-wait-storage.service media.mount \ systemd-tmpfiles-clean.service systemd-tmpfiles-clean.timer +## remove because it cannot be disabled +remove usr/lib/systemd/system-generators/lvm2-activation-generator + ## Make logind activate anaconda-shell@.service on switch to empty VT symlink anaconda-shell@.service lib/systemd/system/autovt@.service replace "#ReserveVT=6" "ReserveVT=2" etc/systemd/logind.conf diff --git a/src/pylorax/ltmpl.py b/src/pylorax/ltmpl.py index 73c8c60f..2e092942 100644 --- a/src/pylorax/ltmpl.py +++ b/src/pylorax/ltmpl.py @@ -642,11 +642,13 @@ class LoraxTemplateRunner(object): logger.debug("systemctl: no units given for %s, ignoring", cmd) return self.mkdir("/run/systemd/system") # XXX workaround for systemctl bug - systemctl = ('systemctl', '--root', self.outroot, '--no-reload', - '--quiet', cmd) + systemctl = ['systemctl', '--root', self.outroot, '--no-reload', + cmd] + # When a unit doesn't exist systemd aborts the command. Run them one at a time. # XXX for some reason 'systemctl enable/disable' always returns 1 - try: - cmd = systemctl + units - runcmd(cmd) - except CalledProcessError: - pass + for unit in units: + try: + cmd = systemctl + [unit] + runcmd(cmd) + except CalledProcessError: + pass