Merge pull request #229 from bhush9/disable-services
Allow to disable services
This commit is contained in:
commit
aacf6a41e1
@ -26,6 +26,7 @@ def run():
|
||||
""" Setup systemd services """
|
||||
services = libcalamares.job.configuration['services']
|
||||
targets = libcalamares.job.configuration['targets']
|
||||
disable = libcalamares.job.configuration['disable']
|
||||
|
||||
# enable services
|
||||
for svc in services:
|
||||
@ -51,4 +52,15 @@ def run():
|
||||
libcalamares.utils.debug("Cannot enable systemd target {}".format(tgt['name']))
|
||||
libcalamares.utils.debug("systemctl enable call in chroot returned error code {}".format(ec))
|
||||
|
||||
for dbl in disable:
|
||||
ec = libcalamares.utils.chroot_call(['systemctl', 'disable', '{}.service'.format(dbl['name'])])
|
||||
|
||||
if ec != 0:
|
||||
if dbl['mandatory']:
|
||||
return "Cannot disable systemd service {}".format(dbl['name']), \
|
||||
"systemctl disable call in chroot returned error code {}".format(ec)
|
||||
else:
|
||||
libcalamares.utils.debug("Cannot disable systemd service {}".format(dbl['name']))
|
||||
libcalamares.utils.debug("systemctl disable call in chroot returned error code {}".format(ec))
|
||||
|
||||
return None
|
||||
|
@ -11,3 +11,7 @@ services:
|
||||
targets:
|
||||
- name: "graphical"
|
||||
mandatory: true
|
||||
|
||||
disable:
|
||||
- name: "pacman-init"
|
||||
mandatory: false
|
||||
|
Loading…
Reference in New Issue
Block a user