Fix systemctl command (#1478247)
When multiple units are passed to systemctl and one fails it doesn't finish the others. Change the template command to call systemctl for each unit individually. This also removes the lvm2-activation-generator in runtime-cleanup.tmpl Resolves: rhbz#1478247
This commit is contained in:
parent
1b29041089
commit
5238b9cd18
@ -43,6 +43,9 @@ systemctl mask rhel-configure.service rhel-loadmodules.service \
|
|||||||
rhel-wait-storage.service media.mount \
|
rhel-wait-storage.service media.mount \
|
||||||
systemd-tmpfiles-clean.service systemd-tmpfiles-clean.timer
|
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
|
## Make logind activate anaconda-shell@.service on switch to empty VT
|
||||||
symlink anaconda-shell@.service lib/systemd/system/autovt@.service
|
symlink anaconda-shell@.service lib/systemd/system/autovt@.service
|
||||||
replace "#ReserveVT=6" "ReserveVT=2" etc/systemd/logind.conf
|
replace "#ReserveVT=6" "ReserveVT=2" etc/systemd/logind.conf
|
||||||
|
@ -642,11 +642,13 @@ class LoraxTemplateRunner(object):
|
|||||||
logger.debug("systemctl: no units given for %s, ignoring", cmd)
|
logger.debug("systemctl: no units given for %s, ignoring", cmd)
|
||||||
return
|
return
|
||||||
self.mkdir("/run/systemd/system") # XXX workaround for systemctl bug
|
self.mkdir("/run/systemd/system") # XXX workaround for systemctl bug
|
||||||
systemctl = ('systemctl', '--root', self.outroot, '--no-reload',
|
systemctl = ['systemctl', '--root', self.outroot, '--no-reload',
|
||||||
'--quiet', cmd)
|
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
|
# XXX for some reason 'systemctl enable/disable' always returns 1
|
||||||
try:
|
for unit in units:
|
||||||
cmd = systemctl + units
|
try:
|
||||||
runcmd(cmd)
|
cmd = systemctl + [unit]
|
||||||
except CalledProcessError:
|
runcmd(cmd)
|
||||||
pass
|
except CalledProcessError:
|
||||||
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user