From b02ee3cd8d033660bfdbaf1d21ad407115e67be3 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 27 Jun 2018 09:46:43 -0400 Subject: [PATCH] [services-openrc] Follow services-systemd configuration example - Based on comments from #974, follow the configuration scheme from services-systemd, so with separate lists "services" and "disable". This ties it **slightly** less closely to the commands passed to rc-config. --- src/modules/services-openrc/main.py | 7 +++++- .../services-openrc/services-openrc.conf | 24 +++++++++---------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/modules/services-openrc/main.py b/src/modules/services-openrc/main.py index cfa7fd457..63d17bcc0 100644 --- a/src/modules/services-openrc/main.py +++ b/src/modules/services-openrc/main.py @@ -36,7 +36,12 @@ class OpenrcController: def __init__(self): self.root = libcalamares.globalstorage.value('rootMountPoint') - self.services = libcalamares.job.configuration.get('services', []) + + # Translate the entries in the config to the actions passed to rc-config + self.services = dict() + self.services["add"] = libcalamares.job.configuration.get('services', []) + self.services["del"] = libcalamares.job.configuration.get('disable', []) + self.initdDir = libcalamares.job.configuration['initdDir'] self.runlevelsDir = libcalamares.job.configuration['runlevelsDir'] diff --git a/src/modules/services-openrc/services-openrc.conf b/src/modules/services-openrc/services-openrc.conf index 61440f692..c89c82a32 100644 --- a/src/modules/services-openrc/services-openrc.conf +++ b/src/modules/services-openrc/services-openrc.conf @@ -13,25 +13,25 @@ initdDir: /etc/init.d # runlevelsDir: holds the runlevels directory location runlevelsDir: /etc/runlevels -# services: each subkey of *services* is an action to take; -# supported actions are "add" and "del". The each subkey -# has a list of entries as value, and each entry has two -# fields: +# services: a list of entries to **enable** +# disable: a list of entries to **disable** +# +# Each entry has two fields: # - name: the service name # - runlevel: can hold any runlevel present on the target system; # if no runlevel is provided, "default" is assumed. # -# # Example services: +# # Example services and disable settings: # # - add foo1 to default # # - add foo2 to nonetwork # # - remove foo3 from default # services: -# add: -# - name: foo1 -# - name: foo2 -# runlevel: nonetwork -# del: -# - name: foo3 -# runlevel: default +# - name: foo1 +# - name: foo2 +# runlevel: nonetwork +# disable: +# - name: foo3 +# runlevel: default services: [] +disable: []