Skip to content

Commit b4f126f

Browse files
authored
Systemd based runner default on core (bugfix) (#2247)
* Make systemd_based_runner default on core * Use bugfixed version of plz-run (escape $) * Fix typo in pam profile name
1 parent 464f76f commit b4f126f

File tree

8 files changed

+17
-9
lines changed

8 files changed

+17
-9
lines changed

checkbox-core-snap/series16/snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ parts:
9898
################################################################################
9999
plz-run:
100100
plugin: go
101-
source: https://gitlab.com/zygoon/plz-run.git
101+
source: https://github.com/Hook25/plz-run.git
102102
source-type: git
103103
################################################################################
104104
# Upstream: https://kernel.ubuntu.com/git/hwe/fwts.git/plain/snapcraft.yaml

checkbox-core-snap/series18/snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ parts:
102102
################################################################################
103103
plz-run:
104104
plugin: go
105-
source: https://gitlab.com/zygoon/plz-run.git
105+
source: https://github.com/Hook25/plz-run.git
106106
source-type: git
107107
################################################################################
108108
# Upstream: https://github.com/fwts/fwts/blob/master/snapcraft.yaml

checkbox-core-snap/series20/snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ parts:
102102
################################################################################
103103
plz-run:
104104
plugin: go
105-
source: https://gitlab.com/zygoon/plz-run.git
105+
source: https://github.com/Hook25/plz-run.git
106106
source-type: git
107107
################################################################################
108108
# Upstream: https://github.com/fwts/fwts/blob/master/snapcraft.yaml

checkbox-core-snap/series22/snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ parts:
108108
################################################################################
109109
plz-run:
110110
plugin: go
111-
source: https://gitlab.com/zygoon/plz-run.git
111+
source: https://github.com/Hook25/plz-run.git
112112
build-snaps:
113113
- go/latest/stable
114114
################################################################################

checkbox-core-snap/series24/snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ parts:
106106
################################################################################
107107
plz-run:
108108
plugin: go
109-
source: https://gitlab.com/zygoon/plz-run.git
109+
source: https://github.com/Hook25/plz-run.git
110110
build-snaps:
111111
- go/latest/stable
112112
################################################################################

checkbox-ng/plainbox/impl/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ class DynamicSection(dict):
412412
),
413413
"systemd_based_job_runner": VarSpec(
414414
bool,
415-
False,
415+
None,
416416
"Run Checkbox jobs as a systemd unit escaping the snap sandbox",
417417
),
418418
},

checkbox-ng/plainbox/impl/execution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ def get_execution_command_systemd_unit(
780780
target_user,
781781
]
782782
if target_user != "root":
783-
cmd += ["-pam", "systemd-login"]
783+
cmd += ["-pam", "system-login"]
784784
env = get_differential_execution_environment(
785785
job, environ, session_id, nest_dir, extra_env
786786
)

checkbox-ng/plainbox/impl/session/state.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from plainbox.impl.unit.job import JobDefinition
4545
from plainbox.impl.unit.unit_with_id import UnitWithId
4646
from plainbox.impl.unit.testplan import TestPlanUnitSupport
47+
from plainbox.impl.unit.unit import on_ubuntucore
4748
from plainbox.suspend_consts import Suspend
4849
from plainbox.vendor import morris
4950

@@ -178,16 +179,23 @@ def update_feature_flags(self, config):
178179
self._flags.add(self.FLAG_FEATURE_STRICT_TEMPLATE_EXPANSION)
179180
else:
180181
logger.warning("Using legacy non-strict template expansion")
181-
if config.get_value("features", "systemd_based_job_runner"):
182+
systemd_based_job_runner = config.get_value(
183+
"features", "systemd_based_job_runner"
184+
)
185+
if systemd_based_job_runner is None:
186+
systemd_based_job_runner = on_ubuntucore()
187+
if systemd_based_job_runner:
182188
if shutil.which("plz-run"):
183-
logger.warning("Using experimental systemd-based runner")
189+
logger.info("Using systemd-based runner")
184190
self._flags.add(self.FLAG_FEATURE_SYSTEMD_BASED_JOB_RUNNER)
185191
else:
186192
logger.error(
187193
"Experimental systemd-based runner was requested but "
188194
"required dependency plz-run is not installed"
189195
)
190196
logger.error("Falling back to shell based runner")
197+
else:
198+
logger.info("Using subprocess-based runner")
191199

192200
@property
193201
def flags(self):

0 commit comments

Comments
 (0)